Package org.apache.tools.ant.taskdefs
Class MatchingTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.tools.ant.taskdefs.MatchingTask
-
- All Implemented Interfaces:
java.lang.Cloneable,SelectorContainer
- Direct Known Subclasses:
Cab,Checksum,Copydir,Delete,Depend,DependSet,EjbJar,FixCRLF,Image,ImageIOTask,Javac,JlinkTask,JspC,Native2Ascii,NetRexxC,RenameExtensions,Replace,Rmic,Tar,Translate,WLJspc,XSLTProcess,Zip
public abstract class MatchingTask extends Task implements SelectorContainer
This is an abstract task that should be used by all those tasks that require to include or exclude files based on pattern matching.- Since:
- Ant 1.1
-
-
Constructor Summary
Constructors Constructor Description MatchingTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(FileSelector selector)add an arbitrary selectorvoidaddAnd(AndSelector selector)add an "And" selector entry on the selector listvoidaddContains(ContainsSelector selector)add a contains selector entry on the selector listvoidaddContainsRegexp(ContainsRegexpSelector selector)add a regular expression selector entry on the selector listvoidaddCustom(ExtendSelector selector)add an extended selector entry on the selector listvoidaddDate(DateSelector selector)add a selector date entry on the selector listvoidaddDepend(DependSelector selector)add a depends selector entry on the selector listvoidaddDepth(DepthSelector selector)add a depth selector entry on the selector listvoidaddDifferent(DifferentSelector selector)add a type selector entry on the type listvoidaddFilename(FilenameSelector selector)add a selector filename entry on the selector listvoidaddMajority(MajoritySelector selector)add a majority selector entry on the selector listvoidaddModified(ModifiedSelector selector)add the modified selectorvoidaddNone(NoneSelector selector)add a "None" selector entry on the selector listvoidaddNot(NotSelector selector)add a "Not" selector entry on the selector listvoidaddOr(OrSelector selector)add an "Or" selector entry on the selector listvoidaddPresent(PresentSelector selector)add a present selector entry on the selector listvoidaddSelector(SelectSelector selector)add a "Select" selector entry on the selector listvoidaddSize(SizeSelector selector)add a selector size entry on the selector listvoidaddType(TypeSelector selector)add a type selector entry on the type listvoidappendSelector(FileSelector selector)Add a new selector into this container.PatternSet.NameEntrycreateExclude()add a name entry on the exclude listPatternSet.NameEntrycreateExcludesFile()add a name entry on the include files listPatternSet.NameEntrycreateInclude()add a name entry on the include listPatternSet.NameEntrycreateIncludesFile()add a name entry on the include files listPatternSetcreatePatternSet()add a set of patternsprotected DirectoryScannergetDirectoryScanner(java.io.File baseDir)Returns the directory scanner needed to access the files to process.protected FileSetgetImplicitFileSet()Accessor for the implicit fileset.FileSelector[]getSelectors(Project p)Returns the set of selectors as an array.booleanhasSelectors()Indicates whether there are any selectors here.intselectorCount()Gives the count of the number of selectors in this containerjava.util.Enumeration<FileSelector>selectorElements()Returns an enumerator for accessing the set of selectors.voidsetCaseSensitive(boolean isCaseSensitive)Sets case sensitivity of the file systemvoidsetDefaultexcludes(boolean useDefaultExcludes)Sets whether default exclusions should be used or not.voidsetExcludes(java.lang.String excludes)Sets the set of exclude patterns.voidsetExcludesfile(java.io.File excludesfile)Sets the name of the file containing the includes patterns.voidsetFollowSymlinks(boolean followSymlinks)Sets whether or not symbolic links should be followed.voidsetIncludes(java.lang.String includes)Sets the set of include patterns.voidsetIncludesfile(java.io.File includesfile)Sets the name of the file containing the includes patterns.voidsetProject(Project project)Sets the project object of this component.voidXsetIgnore(java.lang.String ignoreString)List of filenames and directory names to not include.voidXsetItems(java.lang.String itemString)Set this to be the items in the base directory that you want to be included.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, execute, 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
-
-
-
-
Field Detail
-
fileset
protected FileSet fileset
-
-
Method Detail
-
setProject
public void setProject(Project project)
Sets the project object of this component. This method is used by Project when a component is added to it so that the component has access to the functions of the project. It should not be used for any other purpose..- Overrides:
setProjectin classProjectComponent- Parameters:
project- Project in whose scope this component belongs. Must not benull.
-
createInclude
public PatternSet.NameEntry createInclude()
add a name entry on the include list- Returns:
- a NameEntry object to be configured
-
createIncludesFile
public PatternSet.NameEntry createIncludesFile()
add a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
-
createExclude
public PatternSet.NameEntry createExclude()
add a name entry on the exclude list- Returns:
- an NameEntry object to be configured
-
createExcludesFile
public PatternSet.NameEntry createExcludesFile()
add a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
-
createPatternSet
public PatternSet createPatternSet()
add a set of patterns- Returns:
- PatternSet object to be configured
-
setIncludes
public void setIncludes(java.lang.String includes)
Sets the set of include patterns. Patterns may be separated by a comma or a space.- Parameters:
includes- the string containing the include patterns
-
XsetItems
public void XsetItems(java.lang.String itemString)
Set this to be the items in the base directory that you want to be included. You can also specify "*" for the items (ie: items="*") and it will include all the items in the base directory.- Parameters:
itemString- the string containing the files to include.
-
setExcludes
public void setExcludes(java.lang.String excludes)
Sets the set of exclude patterns. Patterns may be separated by a comma or a space.- Parameters:
excludes- the string containing the exclude patterns
-
XsetIgnore
public void XsetIgnore(java.lang.String ignoreString)
List of filenames and directory names to not include. They should be either comma or space separated. The ignored files will be logged.- Parameters:
ignoreString- the string containing the files to ignore.
-
setDefaultexcludes
public void setDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.- Parameters:
useDefaultExcludes- "true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.
-
getDirectoryScanner
protected DirectoryScanner getDirectoryScanner(java.io.File baseDir)
Returns the directory scanner needed to access the files to process.- Parameters:
baseDir- the base directory to use with the fileset- Returns:
- a directory scanner
-
setIncludesfile
public void setIncludesfile(java.io.File includesfile)
Sets the name of the file containing the includes patterns.- Parameters:
includesfile- A string containing the filename to fetch the include patterns from.
-
setExcludesfile
public void setExcludesfile(java.io.File excludesfile)
Sets the name of the file containing the includes patterns.- Parameters:
excludesfile- A string containing the filename to fetch the include patterns from.
-
setCaseSensitive
public void setCaseSensitive(boolean isCaseSensitive)
Sets case sensitivity of the file system- Parameters:
isCaseSensitive- "true"|"on"|"yes" if file system is case sensitive, "false"|"off"|"no" when not.
-
setFollowSymlinks
public void setFollowSymlinks(boolean followSymlinks)
Sets whether or not symbolic links should be followed.- Parameters:
followSymlinks- whether or not symbolic links should be followed
-
hasSelectors
public boolean hasSelectors()
Indicates whether there are any selectors here.- Specified by:
hasSelectorsin interfaceSelectorContainer- Returns:
- whether any selectors are in this container
-
selectorCount
public int selectorCount()
Gives the count of the number of selectors in this container- Specified by:
selectorCountin interfaceSelectorContainer- Returns:
- the number of selectors in this container
-
getSelectors
public FileSelector[] getSelectors(Project p)
Returns the set of selectors as an array.- Specified by:
getSelectorsin interfaceSelectorContainer- Parameters:
p- the current project- Returns:
- an array of selectors in this container
-
selectorElements
public java.util.Enumeration<FileSelector> selectorElements()
Returns an enumerator for accessing the set of selectors.- Specified by:
selectorElementsin interfaceSelectorContainer- Returns:
- an enumerator that goes through each of the selectors
-
appendSelector
public void appendSelector(FileSelector selector)
Add a new selector into this container.- Specified by:
appendSelectorin interfaceSelectorContainer- Parameters:
selector- the new selector to add
-
addSelector
public void addSelector(SelectSelector selector)
add a "Select" selector entry on the selector list- Specified by:
addSelectorin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addAnd
public void addAnd(AndSelector selector)
add an "And" selector entry on the selector list- Specified by:
addAndin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addOr
public void addOr(OrSelector selector)
add an "Or" selector entry on the selector list- Specified by:
addOrin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addNot
public void addNot(NotSelector selector)
add a "Not" selector entry on the selector list- Specified by:
addNotin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addNone
public void addNone(NoneSelector selector)
add a "None" selector entry on the selector list- Specified by:
addNonein interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addMajority
public void addMajority(MajoritySelector selector)
add a majority selector entry on the selector list- Specified by:
addMajorityin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addDate
public void addDate(DateSelector selector)
add a selector date entry on the selector list- Specified by:
addDatein interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addSize
public void addSize(SizeSelector selector)
add a selector size entry on the selector list- Specified by:
addSizein interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addFilename
public void addFilename(FilenameSelector selector)
add a selector filename entry on the selector list- Specified by:
addFilenamein interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addCustom
public void addCustom(ExtendSelector selector)
add an extended selector entry on the selector list- Specified by:
addCustomin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addContains
public void addContains(ContainsSelector selector)
add a contains selector entry on the selector list- Specified by:
addContainsin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addPresent
public void addPresent(PresentSelector selector)
add a present selector entry on the selector list- Specified by:
addPresentin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addDepth
public void addDepth(DepthSelector selector)
add a depth selector entry on the selector list- Specified by:
addDepthin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addDepend
public void addDepend(DependSelector selector)
add a depends selector entry on the selector list- Specified by:
addDependin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addContainsRegexp
public void addContainsRegexp(ContainsRegexpSelector selector)
add a regular expression selector entry on the selector list- Specified by:
addContainsRegexpin interfaceSelectorContainer- Parameters:
selector- the selector to add
-
addDifferent
public void addDifferent(DifferentSelector selector)
add a type selector entry on the type list- Specified by:
addDifferentin interfaceSelectorContainer- Parameters:
selector- the selector to add- Since:
- ant 1.6
-
addType
public void addType(TypeSelector selector)
add a type selector entry on the type list- Specified by:
addTypein interfaceSelectorContainer- Parameters:
selector- the selector to add- Since:
- ant 1.6
-
addModified
public void addModified(ModifiedSelector selector)
add the modified selector- Specified by:
addModifiedin interfaceSelectorContainer- Parameters:
selector- the selector to add- Since:
- ant 1.6
-
add
public void add(FileSelector selector)
add an arbitrary selector- Specified by:
addin interfaceSelectorContainer- Parameters:
selector- the selector to add- Since:
- Ant 1.6
-
getImplicitFileSet
protected final FileSet getImplicitFileSet()
Accessor for the implicit fileset.- Returns:
- the implicit fileset
- Since:
- Ant 1.5.2
-
-