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:
- 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
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
- 
Field SummaryFieldsFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(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.add a name entry on the exclude listadd a name entry on the include files listadd a name entry on the include listadd a name entry on the include files listadd a set of patternsprotected DirectoryScannergetDirectoryScanner(File baseDir) Returns the directory scanner needed to access the files to process.protected final FileSetAccessor for the implicit fileset.Returns the set of selectors as an array.booleanIndicates whether there are any selectors here.intGives the count of the number of selectors in this containerReturns 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(String excludes) Sets the set of exclude patterns.voidsetExcludesfile(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(String includes) Sets the set of include patterns.voidsetIncludesfile(File includesfile) Sets the name of the file containing the includes patterns.voidsetProject(Project project) Sets the project object of this component.voidXsetIgnore(String ignoreString) List of filenames and directory names to not include.voidSet this to be the items in the base directory that you want to be included.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation
- 
Field Details- 
fileset
 
- 
- 
Constructor Details- 
MatchingTaskpublic MatchingTask()
 
- 
- 
Method Details- 
setProjectSets 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 class- ProjectComponent
- Parameters:
- project- Project in whose scope this component belongs. Must not be- null.
 
- 
createIncludeadd a name entry on the include list- Returns:
- a NameEntry object to be configured
 
- 
createIncludesFileadd a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
 
- 
createExcludeadd a name entry on the exclude list- Returns:
- an NameEntry object to be configured
 
- 
createExcludesFileadd a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
 
- 
createPatternSetadd a set of patterns- Returns:
- PatternSet object to be configured
 
- 
setIncludesSets the set of include patterns. Patterns may be separated by a comma or a space.- Parameters:
- includes- the string containing the include patterns
 
- 
XsetItemsSet 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.
 
- 
setExcludesSets the set of exclude patterns. Patterns may be separated by a comma or a space.- Parameters:
- excludes- the string containing the exclude patterns
 
- 
XsetIgnoreList 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.
 
- 
setDefaultexcludespublic 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.
 
- 
getDirectoryScannerReturns the directory scanner needed to access the files to process.- Parameters:
- baseDir- the base directory to use with the fileset
- Returns:
- a directory scanner
 
- 
setIncludesfileSets the name of the file containing the includes patterns.- Parameters:
- includesfile- A string containing the filename to fetch the include patterns from.
 
- 
setExcludesfileSets the name of the file containing the includes patterns.- Parameters:
- excludesfile- A string containing the filename to fetch the include patterns from.
 
- 
setCaseSensitivepublic 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.
 
- 
setFollowSymlinkspublic void setFollowSymlinks(boolean followSymlinks) Sets whether or not symbolic links should be followed.- Parameters:
- followSymlinks- whether or not symbolic links should be followed
 
- 
hasSelectorspublic boolean hasSelectors()Indicates whether there are any selectors here.- Specified by:
- hasSelectorsin interface- SelectorContainer
- Returns:
- whether any selectors are in this container
 
- 
selectorCountpublic int selectorCount()Gives the count of the number of selectors in this container- Specified by:
- selectorCountin interface- SelectorContainer
- Returns:
- the number of selectors in this container
 
- 
getSelectorsReturns the set of selectors as an array.- Specified by:
- getSelectorsin interface- SelectorContainer
- Parameters:
- p- the current project
- Returns:
- an array of selectors in this container
 
- 
selectorElementsReturns an enumerator for accessing the set of selectors.- Specified by:
- selectorElementsin interface- SelectorContainer
- Returns:
- an enumerator that goes through each of the selectors
 
- 
appendSelectorAdd a new selector into this container.- Specified by:
- appendSelectorin interface- SelectorContainer
- Parameters:
- selector- the new selector to add
 
- 
addSelectoradd a "Select" selector entry on the selector list- Specified by:
- addSelectorin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addAndadd an "And" selector entry on the selector list- Specified by:
- addAndin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addOradd an "Or" selector entry on the selector list- Specified by:
- addOrin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addNotadd a "Not" selector entry on the selector list- Specified by:
- addNotin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addNoneadd a "None" selector entry on the selector list- Specified by:
- addNonein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addMajorityadd a majority selector entry on the selector list- Specified by:
- addMajorityin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addDateadd a selector date entry on the selector list- Specified by:
- addDatein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addSizeadd a selector size entry on the selector list- Specified by:
- addSizein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addFilenameadd a selector filename entry on the selector list- Specified by:
- addFilenamein interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addCustomadd an extended selector entry on the selector list- Specified by:
- addCustomin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addContainsadd a contains selector entry on the selector list- Specified by:
- addContainsin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addPresentadd a present selector entry on the selector list- Specified by:
- addPresentin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addDepthadd a depth selector entry on the selector list- Specified by:
- addDepthin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addDependadd a depends selector entry on the selector list- Specified by:
- addDependin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addContainsRegexpadd a regular expression selector entry on the selector list- Specified by:
- addContainsRegexpin interface- SelectorContainer
- Parameters:
- selector- the selector to add
 
- 
addDifferentadd a type selector entry on the type list- Specified by:
- addDifferentin interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- ant 1.6
 
- 
addTypeadd a type selector entry on the type list- Specified by:
- addTypein interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- ant 1.6
 
- 
addModifiedadd the modified selector- Specified by:
- addModifiedin interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- ant 1.6
 
- 
addadd an arbitrary selector- Specified by:
- addin interface- SelectorContainer
- Parameters:
- selector- the selector to add
- Since:
- Ant 1.6
 
- 
getImplicitFileSetAccessor for the implicit fileset.- Returns:
- the implicit fileset
- Since:
- Ant 1.5.2
 
 
-