org.sitemesh.ant
Class SiteMeshTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.sitemesh.ant.SiteMeshTask
All Implemented Interfaces:
Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer

public class SiteMeshTask
extends org.apache.tools.ant.taskdefs.MatchingTask

Author:
Richard L. Burton III - SmartCode LLC, Joe Walnes

Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
SiteMeshTask()
           
 
Method Summary
 void addSiteMeshfileset(SiteMeshFileSet fileset)
           
protected  void applyCustomConfiguration(SiteMeshOfflineBuilder builder)
          Override this to apply custom configuration after after the default configuration mechanisms.
protected  SiteMeshOffline createSiteMeshOffline(org.apache.tools.ant.types.FileSet fileset)
          Creates The SiteMeshOffline generator for the given FileSet.
 void execute()
           
protected  List<org.apache.tools.ant.types.FileSet> getImplicitAndExplicitFileSet()
          Returns the all implicit and explicit FileSets.
protected  boolean hasDestdir(org.apache.tools.ant.types.FileSet fileset)
          Checks to if the FileSet has a destdir set.
protected  boolean isSiteMeshFileSet(org.apache.tools.ant.types.FileSet fileset)
           
protected  boolean isSiteMeshFileSetWithoutDecorator(org.apache.tools.ant.types.FileSet fileset)
          A helper method that checks if the given FileSet is an instance of SiteMesh and no decorator was set on the given FileSet.
protected  Element parseSiteMeshXmlConfig(File config)
           
protected  void processFileSet(List<org.apache.tools.ant.types.FileSet> filesets)
          Processes the FileSet to decorate all of the provided files.
 void setConfig(File config)
          Optional path to SiteMesh XML config file.
 void setDestdir(File destDir)
          Destination directory where decorated content will be output to.
 void setSrcdir(File srcDir)
          Source directory containing undecorated content and decorators.
protected  void verify()
          Verify the required parameters.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteMeshTask

public SiteMeshTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

getImplicitAndExplicitFileSet

protected List<org.apache.tools.ant.types.FileSet> getImplicitAndExplicitFileSet()
Returns the all implicit and explicit FileSets.

Returns:
The FileSets to process.

verify

protected void verify()
               throws org.apache.tools.ant.BuildException
Verify the required parameters.

Throws:
org.apache.tools.ant.BuildException - If either the source or destination directories are not set.

processFileSet

protected void processFileSet(List<org.apache.tools.ant.types.FileSet> filesets)
Processes the FileSet to decorate all of the provided files.

Parameters:
filesets - The set of files to be processed.
Throws:
org.apache.tools.ant.BuildException - When there's a problem decorating the files.

createSiteMeshOffline

protected SiteMeshOffline createSiteMeshOffline(org.apache.tools.ant.types.FileSet fileset)
Creates The SiteMeshOffline generator for the given FileSet.

Parameters:
fileset - The FileSet to be processed.
Returns:
An instance of SiteMeshOffline.

isSiteMeshFileSetWithoutDecorator

protected boolean isSiteMeshFileSetWithoutDecorator(org.apache.tools.ant.types.FileSet fileset)
A helper method that checks if the given FileSet is an instance of SiteMesh and no decorator was set on the given FileSet.

Parameters:
fileset - The FileSet to inspect.
Returns:
True if the FileSet is an instance of SiteMeshFileSet and no decorator was set, false otherwise.

hasDestdir

protected boolean hasDestdir(org.apache.tools.ant.types.FileSet fileset)
Checks to if the FileSet has a destdir set.

Parameters:
fileset - The FileSet to check.
Returns:
true if the destdir is set, false otherwise.

isSiteMeshFileSet

protected boolean isSiteMeshFileSet(org.apache.tools.ant.types.FileSet fileset)

parseSiteMeshXmlConfig

protected Element parseSiteMeshXmlConfig(File config)
                                  throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

applyCustomConfiguration

protected void applyCustomConfiguration(SiteMeshOfflineBuilder builder)
Override this to apply custom configuration after after the default configuration mechanisms.

Parameters:
builder - The SitemeshOfflineBuilder used in creating the SiteMeshOfflineGenerator.

setDestdir

public void setDestdir(File destDir)
Destination directory where decorated content will be output to.


setSrcdir

public void setSrcdir(File srcDir)
Source directory containing undecorated content and decorators.


setConfig

public void setConfig(File config)
Optional path to SiteMesh XML config file.


addSiteMeshfileset

public void addSiteMeshfileset(SiteMeshFileSet fileset)


Copyright © 2011. All Rights Reserved.