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 Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(FileSelector selector) add an arbitrary selectorvoid
addAnd
(AndSelector selector) add an "And" selector entry on the selector listvoid
addContains
(ContainsSelector selector) add a contains selector entry on the selector listvoid
addContainsRegexp
(ContainsRegexpSelector selector) add a regular expression selector entry on the selector listvoid
addCustom
(ExtendSelector selector) add an extended selector entry on the selector listvoid
addDate
(DateSelector selector) add a selector date entry on the selector listvoid
addDepend
(DependSelector selector) add a depends selector entry on the selector listvoid
addDepth
(DepthSelector selector) add a depth selector entry on the selector listvoid
addDifferent
(DifferentSelector selector) add a type selector entry on the type listvoid
addFilename
(FilenameSelector selector) add a selector filename entry on the selector listvoid
addMajority
(MajoritySelector selector) add a majority selector entry on the selector listvoid
addModified
(ModifiedSelector selector) add the modified selectorvoid
addNone
(NoneSelector selector) add a "None" selector entry on the selector listvoid
addNot
(NotSelector selector) add a "Not" selector entry on the selector listvoid
addOr
(OrSelector selector) add an "Or" selector entry on the selector listvoid
addPresent
(PresentSelector selector) add a present selector entry on the selector listvoid
addSelector
(SelectSelector selector) add a "Select" selector entry on the selector listvoid
addSize
(SizeSelector selector) add a selector size entry on the selector listvoid
addType
(TypeSelector selector) add a type selector entry on the type listvoid
appendSelector
(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 DirectoryScanner
getDirectoryScanner
(File baseDir) Returns the directory scanner needed to access the files to process.protected final FileSet
Accessor for the implicit fileset.Returns the set of selectors as an array.boolean
Indicates whether there are any selectors here.int
Gives the count of the number of selectors in this containerReturns an enumerator for accessing the set of selectors.void
setCaseSensitive
(boolean isCaseSensitive) Sets case sensitivity of the file systemvoid
setDefaultexcludes
(boolean useDefaultExcludes) Sets whether default exclusions should be used or not.void
setExcludes
(String excludes) Sets the set of exclude patterns.void
setExcludesfile
(File excludesfile) Sets the name of the file containing the includes patterns.void
setFollowSymlinks
(boolean followSymlinks) Sets whether or not symbolic links should be followed.void
setIncludes
(String includes) Sets the set of include patterns.void
setIncludesfile
(File includesfile) Sets the name of the file containing the includes patterns.void
setProject
(Project project) Sets the project object of this component.void
XsetIgnore
(String ignoreString) List of filenames and directory names to not include.void
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 Details
-
fileset
-
-
Constructor Details
-
MatchingTask
public MatchingTask()
-
-
Method Details
-
setProject
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:
setProject
in classProjectComponent
- Parameters:
project
- Project in whose scope this component belongs. Must not benull
.
-
createInclude
add a name entry on the include list- Returns:
- a NameEntry object to be configured
-
createIncludesFile
add a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
-
createExclude
add a name entry on the exclude list- Returns:
- an NameEntry object to be configured
-
createExcludesFile
add a name entry on the include files list- Returns:
- an PatternFileNameEntry object to be configured
-
createPatternSet
add a set of patterns- Returns:
- PatternSet object to be configured
-
setIncludes
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
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
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
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
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
Sets the name of the file containing the includes patterns.- Parameters:
includesfile
- A string containing the filename to fetch the include patterns from.
-
setExcludesfile
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:
hasSelectors
in 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:
selectorCount
in interfaceSelectorContainer
- Returns:
- the number of selectors in this container
-
getSelectors
Returns the set of selectors as an array.- Specified by:
getSelectors
in interfaceSelectorContainer
- Parameters:
p
- the current project- Returns:
- an array of selectors in this container
-
selectorElements
Returns an enumerator for accessing the set of selectors.- Specified by:
selectorElements
in interfaceSelectorContainer
- Returns:
- an enumerator that goes through each of the selectors
-
appendSelector
Add a new selector into this container.- Specified by:
appendSelector
in interfaceSelectorContainer
- Parameters:
selector
- the new selector to add
-
addSelector
add a "Select" selector entry on the selector list- Specified by:
addSelector
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addAnd
add an "And" selector entry on the selector list- Specified by:
addAnd
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addOr
add an "Or" selector entry on the selector list- Specified by:
addOr
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addNot
add a "Not" selector entry on the selector list- Specified by:
addNot
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addNone
add a "None" selector entry on the selector list- Specified by:
addNone
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addMajority
add a majority selector entry on the selector list- Specified by:
addMajority
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addDate
add a selector date entry on the selector list- Specified by:
addDate
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addSize
add a selector size entry on the selector list- Specified by:
addSize
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addFilename
add a selector filename entry on the selector list- Specified by:
addFilename
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addCustom
add an extended selector entry on the selector list- Specified by:
addCustom
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addContains
add a contains selector entry on the selector list- Specified by:
addContains
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addPresent
add a present selector entry on the selector list- Specified by:
addPresent
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addDepth
add a depth selector entry on the selector list- Specified by:
addDepth
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addDepend
add a depends selector entry on the selector list- Specified by:
addDepend
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addContainsRegexp
add a regular expression selector entry on the selector list- Specified by:
addContainsRegexp
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add
-
addDifferent
add a type selector entry on the type list- Specified by:
addDifferent
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add- Since:
- ant 1.6
-
addType
add a type selector entry on the type list- Specified by:
addType
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add- Since:
- ant 1.6
-
addModified
add the modified selector- Specified by:
addModified
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add- Since:
- ant 1.6
-
add
add an arbitrary selector- Specified by:
add
in interfaceSelectorContainer
- Parameters:
selector
- the selector to add- Since:
- Ant 1.6
-
getImplicitFileSet
Accessor for the implicit fileset.- Returns:
- the implicit fileset
- Since:
- Ant 1.5.2
-