Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public abstract Class MatchingTask

extends Task
implements SelectorContainer
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.types.selectors.SelectorContainer
Known Direct Subclasses
org.apache.tools.ant.taskdefs.Replace, org.apache.tools.ant.taskdefs.Rmic, org.apache.tools.ant.taskdefs.Tar, org.apache.tools.ant.taskdefs.XSLTProcess, org.apache.tools.ant.taskdefs.Zip, org.apache.tools.ant.taskdefs.optional.Cab, org.apache.tools.ant.taskdefs.optional.Native2Ascii, org.apache.tools.ant.taskdefs.optional.RenameExtensions, org.apache.tools.ant.taskdefs.optional.depend.Depend, org.apache.tools.ant.taskdefs.optional.ejb.EjbJar, org.apache.tools.ant.taskdefs.optional.i18n.Translate, org.apache.tools.ant.taskdefs.optional.jlink.JlinkTask, org.apache.tools.ant.taskdefs.optional.jsp.JspC, org.apache.tools.ant.taskdefs.optional.jsp.WLJspc, org.apache.tools.ant.taskdefs.Checksum, org.apache.tools.ant.taskdefs.Copydir, org.apache.tools.ant.taskdefs.Delete, org.apache.tools.ant.taskdefs.DependSet, org.apache.tools.ant.taskdefs.FixCRLF, org.apache.tools.ant.taskdefs.Javac
Imports
java.io.File, java.util.Enumeration, .StringTokenizer, org.apache.tools.ant.DirectoryScanner, .Project, .Task, org.apache.tools.ant.types.FileSet, .PatternSet, org.apache.tools.ant.types.selectors.AndSelector, .ContainsRegexpSelector, .ContainsSelector, .DateSelector, .DependSelector, .DepthSelector, .DifferentSelector, .ExtendSelector, .FileSelector, .FilenameSelector, .MajoritySelector, .NoneSelector, .NotSelector, .OrSelector, .PresentSelector, .SelectSelector, .SelectorContainer, .SizeSelector, .TypeSelector, org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector

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

Modifier and TypeField and Description
protected FileSet
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(FileSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.add.

add an arbitrary selector
public void
addAnd(AndSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addAnd.

add an "And" selector entry on the selector list
public void
addContains(ContainsSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContains.

add a contains selector entry on the selector list
public void
addContainsRegexp(ContainsRegexpSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContainsRegexp.

add a regular expression selector entry on the selector list
public void
addCustom(ExtendSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addCustom.

add an extended selector entry on the selector list
public void
addDate(DateSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDate.

add a selector date entry on the selector list
public void
addDepend(DependSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepend.

add a depends selector entry on the selector list
public void
addDepth(DepthSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepth.

add a depth selector entry on the selector list
public void
addDifferent(DifferentSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDifferent.

add a type selector entry on the type list
public void
addFilename(FilenameSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addFilename.

add a selector filename entry on the selector list
public void
addMajority(MajoritySelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addMajority.

add a majority selector entry on the selector list
public void
addModified(ModifiedSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addModified.

add the modified selector
public void
addNone(NoneSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNone.

add a "None" selector entry on the selector list
public void
addNot(NotSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNot.

add a "Not" selector entry on the selector list
public void
addOr(OrSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addOr.

add an "Or" selector entry on the selector list
public void
addPresent(PresentSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addPresent.

add a present selector entry on the selector list
public void
addSelector(SelectSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSelector.

add a "Select" selector entry on the selector list
public void
addSize(SizeSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSize.

add a selector size entry on the selector list
public void
addType(TypeSelector
the selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addType.

add a type selector entry on the type list
public void
appendSelector(FileSelector
the new selector to add
selector
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.appendSelector.

Add a new selector into this container.
public PatternSet.NameEntry

Returns:

an NameEntry object to be configured
createExclude
()

add a name entry on the exclude list

public PatternSet.NameEntry

Returns:

an PatternFileNameEntry object to be configured
createExcludesFile
()

add a name entry on the include files list

public PatternSet.NameEntry

Returns:

a NameEntry object to be configured
createInclude
()

add a name entry on the include list

public PatternSet.NameEntry

Returns:

an PatternFileNameEntry object to be configured
createIncludesFile
()

add a name entry on the include files list

public PatternSet

Returns:

PatternSet object to be configured
createPatternSet
()

add a set of patterns

protected DirectoryScanner

Returns:

a directory scanner
getDirectoryScanner
(File
the base directory to use with the fileset
baseDir
)

Returns the directory scanner needed to access the files to process.

protected final FileSet

Returns:

the implicit fileset
getImplicitFileSet
()

Accessor for the implicit fileset.

public FileSelector[]

Returns:

an array of selectors in this container
getSelectors
(Project
the current project
p
)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.getSelectors.

Returns the set of selectors as an array.
public boolean

Returns:

whether any selectors are in this container
hasSelectors
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.hasSelectors.

Indicates whether there are any selectors here.
public int

Returns:

the number of selectors in this container
selectorCount
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorCount.

Gives the count of the number of selectors in this container
public Enumeration<FileSelector>

Returns:

an enumerator that goes through each of the selectors
selectorElements
()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorElements.

Returns an enumerator for accessing the set of selectors.
public void
setCaseSensitive(boolean
"true"|"on"|"yes" if file system is case sensitive, "false"|"off"|"no" when not.
isCaseSensitive
)

Sets case sensitivity of the file system

public void
setDefaultexcludes(boolean
"true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.
useDefaultExcludes
)

Sets whether default exclusions should be used or not.

public void
setExcludes(String
the string containing the exclude patterns
excludes
)

Sets the set of exclude patterns.

public void
setExcludesfile(File
A string containing the filename to fetch the include patterns from.
excludesfile
)

Sets the name of the file containing the includes patterns.

public void
setIncludes(String
the string containing the include patterns
includes
)

Sets the set of include patterns.

public void
setIncludesfile(File
A string containing the filename to fetch the include patterns from.
includesfile
)

Sets the name of the file containing the includes patterns.

public void
setProject(Project
Project in whose scope this component belongs. Must not be null.
project
)

Overrides org.apache.tools.ant.ProjectComponent.setProject.

Sets the project object of this component.
public void
XsetIgnore(String
the string containing the files to ignore.
ignoreString
)

List of filenames and directory names to not include.

public void
XsetItems(String
the string containing the files to include.
itemString
)

Set this to be the items in the base directory that you want to be included.

Inherited from org.apache.tools.ant.Task:
bindToOwnerexecutegetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

filesetback to summary
protected FileSet fileset

Constructor Detail

MatchingTaskback to summary
public MatchingTask()

Method Detail

addback to summary
public void add(FileSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.add.

add an arbitrary selector

Parameters
selector:FileSelector

the selector to add

Annotations
@Override
Since
Ant 1.6
addAndback to summary
public void addAnd(AndSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addAnd.

add an "And" selector entry on the selector list

Parameters
selector:AndSelector

the selector to add

Annotations
@Override
addContainsback to summary
public void addContains(ContainsSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContains.

add a contains selector entry on the selector list

Parameters
selector:ContainsSelector

the selector to add

Annotations
@Override
addContainsRegexpback to summary
public void addContainsRegexp(ContainsRegexpSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addContainsRegexp.

add a regular expression selector entry on the selector list

Parameters
selector:ContainsRegexpSelector

the selector to add

Annotations
@Override
addCustomback to summary
public void addCustom(ExtendSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addCustom.

add an extended selector entry on the selector list

Parameters
selector:ExtendSelector

the selector to add

Annotations
@Override
addDateback to summary
public void addDate(DateSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDate.

add a selector date entry on the selector list

Parameters
selector:DateSelector

the selector to add

Annotations
@Override
addDependback to summary
public void addDepend(DependSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepend.

add a depends selector entry on the selector list

Parameters
selector:DependSelector

the selector to add

Annotations
@Override
addDepthback to summary
public void addDepth(DepthSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDepth.

add a depth selector entry on the selector list

Parameters
selector:DepthSelector

the selector to add

Annotations
@Override
addDifferentback to summary
public void addDifferent(DifferentSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addDifferent.

add a type selector entry on the type list

Parameters
selector:DifferentSelector

the selector to add

Annotations
@Override
Since
ant 1.6
addFilenameback to summary
public void addFilename(FilenameSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addFilename.

add a selector filename entry on the selector list

Parameters
selector:FilenameSelector

the selector to add

Annotations
@Override
addMajorityback to summary
public void addMajority(MajoritySelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addMajority.

add a majority selector entry on the selector list

Parameters
selector:MajoritySelector

the selector to add

Annotations
@Override
addModifiedback to summary
public void addModified(ModifiedSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addModified.

add the modified selector

Parameters
selector:ModifiedSelector

the selector to add

Annotations
@Override
Since
ant 1.6
addNoneback to summary
public void addNone(NoneSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNone.

add a "None" selector entry on the selector list

Parameters
selector:NoneSelector

the selector to add

Annotations
@Override
addNotback to summary
public void addNot(NotSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addNot.

add a "Not" selector entry on the selector list

Parameters
selector:NotSelector

the selector to add

Annotations
@Override
addOrback to summary
public void addOr(OrSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addOr.

add an "Or" selector entry on the selector list

Parameters
selector:OrSelector

the selector to add

Annotations
@Override
addPresentback to summary
public void addPresent(PresentSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addPresent.

add a present selector entry on the selector list

Parameters
selector:PresentSelector

the selector to add

Annotations
@Override
addSelectorback to summary
public void addSelector(SelectSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSelector.

add a "Select" selector entry on the selector list

Parameters
selector:SelectSelector

the selector to add

Annotations
@Override
addSizeback to summary
public void addSize(SizeSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addSize.

add a selector size entry on the selector list

Parameters
selector:SizeSelector

the selector to add

Annotations
@Override
addTypeback to summary
public void addType(TypeSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.addType.

add a type selector entry on the type list

Parameters
selector:TypeSelector

the selector to add

Annotations
@Override
Since
ant 1.6
appendSelectorback to summary
public void appendSelector(FileSelector selector)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.appendSelector.

Add a new selector into this container.

Parameters
selector:FileSelector

the new selector to add

Annotations
@Override
createExcludeback to summary
public PatternSet.NameEntry createExclude()

add a name entry on the exclude list

Returns:PatternSet.NameEntry

an NameEntry object to be configured

createExcludesFileback to summary
public PatternSet.NameEntry createExcludesFile()

add a name entry on the include files list

Returns:PatternSet.NameEntry

an PatternFileNameEntry object to be configured

createIncludeback to summary
public PatternSet.NameEntry createInclude()

add a name entry on the include list

Returns:PatternSet.NameEntry

a NameEntry object to be configured

createIncludesFileback to summary
public PatternSet.NameEntry createIncludesFile()

add a name entry on the include files list

Returns:PatternSet.NameEntry

an PatternFileNameEntry object to be configured

createPatternSetback to summary
public PatternSet createPatternSet()

add a set of patterns

Returns:PatternSet

PatternSet object to be configured

getDirectoryScannerback to summary
protected DirectoryScanner getDirectoryScanner(File baseDir)

Returns the directory scanner needed to access the files to process.

Parameters
baseDir:File

the base directory to use with the fileset

Returns:DirectoryScanner

a directory scanner

getImplicitFileSetback to summary
protected final FileSet getImplicitFileSet()

Accessor for the implicit fileset.

Returns:FileSet

the implicit fileset

Since
Ant 1.5.2
getSelectorsback to summary
public FileSelector[] getSelectors(Project p)

Implements org.apache.tools.ant.types.selectors.SelectorContainer.getSelectors.

Returns the set of selectors as an array.

Parameters
p:Project

the current project

Returns:FileSelector[]

an array of selectors in this container

Annotations
@Override
hasSelectorsback to summary
public boolean hasSelectors()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.hasSelectors.

Indicates whether there are any selectors here.

Returns:boolean

whether any selectors are in this container

Annotations
@Override
selectorCountback to summary
public int selectorCount()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorCount.

Gives the count of the number of selectors in this container

Returns:int

the number of selectors in this container

Annotations
@Override
selectorElementsback to summary
public Enumeration<FileSelector> selectorElements()

Implements org.apache.tools.ant.types.selectors.SelectorContainer.selectorElements.

Returns an enumerator for accessing the set of selectors.

Returns:Enumeration<FileSelector>

an enumerator that goes through each of the selectors

Annotations
@Override
setCaseSensitiveback to summary
public void setCaseSensitive(boolean isCaseSensitive)

Sets case sensitivity of the file system

Parameters
isCaseSensitive:boolean

"true"|"on"|"yes" if file system is case sensitive, "false"|"off"|"no" when not.

setDefaultexcludesback to summary
public void setDefaultexcludes(boolean useDefaultExcludes)

Sets whether default exclusions should be used or not.

Parameters
useDefaultExcludes:boolean

"true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.

setExcludesback to summary
public void setExcludes(String excludes)

Sets the set of exclude patterns. Patterns may be separated by a comma or a space.

Parameters
excludes:String

the string containing the exclude patterns

setExcludesfileback to summary
public void setExcludesfile(File excludesfile)

Sets the name of the file containing the includes patterns.

Parameters
excludesfile:File

A string containing the filename to fetch the include patterns from.

setIncludesback to summary
public void setIncludes(String includes)

Sets the set of include patterns. Patterns may be separated by a comma or a space.

Parameters
includes:String

the string containing the include patterns

setIncludesfileback to summary
public void setIncludesfile(File includesfile)

Sets the name of the file containing the includes patterns.

Parameters
includesfile:File

A string containing the filename to fetch the include patterns from.

setProjectback to summary
public void setProject(Project project)

Overrides org.apache.tools.ant.ProjectComponent.setProject.

Doc from org.apache.tools.ant.ProjectComponent.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..

Parameters
project:Project

Project in whose scope this component belongs. Must not be null.

Annotations
@Override
XsetIgnoreback to summary
public void XsetIgnore(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:String

the string containing the files to ignore.

XsetItemsback to summary
public void XsetItems(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:String

the string containing the files to include.