FileDocCategorySizeDatePackage
MatchingTask.javaAPI DocApache Ant 1.7013810Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs

MatchingTask

public abstract class MatchingTask extends org.apache.tools.ant.Task implements org.apache.tools.ant.types.selectors.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

Fields Summary
protected org.apache.tools.ant.types.FileSet
fileset
Constructors Summary
Methods Summary
public voidXsetIgnore(java.lang.String ignoreString)
List of filenames and directory names to not include. They should be either , or " " (space) separated. The ignored files will be logged.

param
ignoreString the string containing the files to ignore.

        log("The ignore attribute is deprecated."
            + "Please use the excludes attribute.", Project.MSG_WARN);
        if (ignoreString != null && ignoreString.length() > 0) {
            StringTokenizer tok = new StringTokenizer(ignoreString, ", ",
                                                      false);
            while (tok.hasMoreTokens()) {
                createExclude().setName("**/" + tok.nextToken().trim() + "/**");
            }
        }
    
public voidXsetItems(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.

param
itemString the string containing the files to include.

        log("The items attribute is deprecated. "
            + "Please use the includes attribute.", Project.MSG_WARN);
        if (itemString == null || itemString.equals("*")
            || itemString.equals(".")) {
            createInclude().setName("**");
        } else {
            StringTokenizer tok = new StringTokenizer(itemString, ", ");
            while (tok.hasMoreTokens()) {
                String pattern = tok.nextToken().trim();
                if (pattern.length() > 0) {
                    createInclude().setName(pattern + "/**");
                }
            }
        }
    
public voidadd(org.apache.tools.ant.types.selectors.FileSelector selector)
add an arbitary selector

param
selector the selector to add
since
Ant 1.6

        fileset.add(selector);
    
public voidaddAnd(org.apache.tools.ant.types.selectors.AndSelector selector)
add an "And" selector entry on the selector list

param
selector the selector to add

        fileset.addAnd(selector);
    
public voidaddContains(org.apache.tools.ant.types.selectors.ContainsSelector selector)
add a contains selector entry on the selector list

param
selector the selector to add

        fileset.addContains(selector);
    
public voidaddContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector)
add a regular expression selector entry on the selector list

param
selector the selector to add

        fileset.addContainsRegexp(selector);
    
public voidaddCustom(org.apache.tools.ant.types.selectors.ExtendSelector selector)
add an extended selector entry on the selector list

param
selector the selector to add

        fileset.addCustom(selector);
    
public voidaddDate(org.apache.tools.ant.types.selectors.DateSelector selector)
add a selector date entry on the selector list

param
selector the selector to add

        fileset.addDate(selector);
    
public voidaddDepend(org.apache.tools.ant.types.selectors.DependSelector selector)
add a depends selector entry on the selector list

param
selector the selector to add

        fileset.addDepend(selector);
    
public voidaddDepth(org.apache.tools.ant.types.selectors.DepthSelector selector)
add a depth selector entry on the selector list

param
selector the selector to add

        fileset.addDepth(selector);
    
public voidaddDifferent(org.apache.tools.ant.types.selectors.DifferentSelector selector)
add a type selector entry on the type list

param
selector the selector to add
since
ant 1.6

        fileset.addDifferent(selector);
    
public voidaddFilename(org.apache.tools.ant.types.selectors.FilenameSelector selector)
add a selector filename entry on the selector list

param
selector the selector to add

        fileset.addFilename(selector);
    
public voidaddMajority(org.apache.tools.ant.types.selectors.MajoritySelector selector)
add a majority selector entry on the selector list

param
selector the selector to add

        fileset.addMajority(selector);
    
public voidaddModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector)
add the modified selector

param
selector the selector to add
since
ant 1.6

        fileset.addModified(selector);
    
public voidaddNone(org.apache.tools.ant.types.selectors.NoneSelector selector)
add a "None" selector entry on the selector list

param
selector the selector to add

        fileset.addNone(selector);
    
public voidaddNot(org.apache.tools.ant.types.selectors.NotSelector selector)
add a "Not" selector entry on the selector list

param
selector the selector to add

        fileset.addNot(selector);
    
public voidaddOr(org.apache.tools.ant.types.selectors.OrSelector selector)
add an "Or" selector entry on the selector list

param
selector the selector to add

        fileset.addOr(selector);
    
public voidaddPresent(org.apache.tools.ant.types.selectors.PresentSelector selector)
add a present selector entry on the selector list

param
selector the selector to add

        fileset.addPresent(selector);
    
public voidaddSelector(org.apache.tools.ant.types.selectors.SelectSelector selector)
add a "Select" selector entry on the selector list

param
selector the selector to add

        fileset.addSelector(selector);
    
public voidaddSize(org.apache.tools.ant.types.selectors.SizeSelector selector)
add a selector size entry on the selector list

param
selector the selector to add

        fileset.addSize(selector);
    
public voidaddType(org.apache.tools.ant.types.selectors.TypeSelector selector)
add a type selector entry on the type list

param
selector the selector to add
since
ant 1.6

        fileset.addType(selector);
    
public voidappendSelector(org.apache.tools.ant.types.selectors.FileSelector selector)
Add a new selector into this container.

param
selector the new selector to add

        fileset.appendSelector(selector);
    
public PatternSet.NameEntrycreateExclude()
add a name entry on the exclude list

return
an NameEntry object to be configured

        return fileset.createExclude();
    
public PatternSet.NameEntrycreateExcludesFile()
add a name entry on the include files list

return
an NameEntry object to be configured

        return fileset.createExcludesFile();
    
public PatternSet.NameEntrycreateInclude()
add a name entry on the include list

return
a NameEntry object to be configured

        return fileset.createInclude();
    
public PatternSet.NameEntrycreateIncludesFile()
add a name entry on the include files list

return
an NameEntry object to be configured

        return fileset.createIncludesFile();
    
public org.apache.tools.ant.types.PatternSetcreatePatternSet()
add a set of patterns

return
PatternSet object to be configured

        return fileset.createPatternSet();
    
protected org.apache.tools.ant.DirectoryScannergetDirectoryScanner(java.io.File baseDir)
Returns the directory scanner needed to access the files to process.

param
baseDir the base directory to use with the fileset
return
a directory scanner

        fileset.setDir(baseDir);
        return fileset.getDirectoryScanner(getProject());
    
protected final org.apache.tools.ant.types.FileSetgetImplicitFileSet()
Accessor for the implicit fileset.

return
the implicit fileset
since
Ant 1.5.2

        return fileset;
    
public org.apache.tools.ant.types.selectors.FileSelector[]getSelectors(org.apache.tools.ant.Project p)
Returns the set of selectors as an array.

param
p the current project
return
an array of selectors in this container

        return fileset.getSelectors(p);
    
public booleanhasSelectors()
Indicates whether there are any selectors here.

return
whether any selectors are in this container

        return fileset.hasSelectors();
    
public intselectorCount()
Gives the count of the number of selectors in this container

return
the number of selectors in this container

        return fileset.selectorCount();
    
public java.util.EnumerationselectorElements()
Returns an enumerator for accessing the set of selectors.

return
an enumerator that goes through each of the selectors

        return fileset.selectorElements();
    
public voidsetCaseSensitive(boolean isCaseSensitive)
Sets case sensitivity of the file system

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

        fileset.setCaseSensitive(isCaseSensitive);
    
public voidsetDefaultexcludes(boolean useDefaultExcludes)
Sets whether default exclusions should be used or not.

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

        fileset.setDefaultexcludes(useDefaultExcludes);
    
public voidsetExcludes(java.lang.String excludes)
Sets the set of exclude patterns. Patterns may be separated by a comma or a space.

param
excludes the string containing the exclude patterns

        fileset.setExcludes(excludes);
    
public voidsetExcludesfile(java.io.File excludesfile)
Sets the name of the file containing the includes patterns.

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

        fileset.setExcludesfile(excludesfile);
    
public voidsetFollowSymlinks(boolean followSymlinks)
Sets whether or not symbolic links should be followed.

param
followSymlinks whether or not symbolic links should be followed

        fileset.setFollowSymlinks(followSymlinks);
    
public voidsetIncludes(java.lang.String includes)
Sets the set of include patterns. Patterns may be separated by a comma or a space.

param
includes the string containing the include patterns

        fileset.setIncludes(includes);
    
public voidsetIncludesfile(java.io.File includesfile)
Sets the name of the file containing the includes patterns.

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

        fileset.setIncludesfile(includesfile);
    
public voidsetProject(org.apache.tools.ant.Project project)
{@inheritDoc}.

    // CheckStyle:VisibilityModifier ON

      
        
        super.setProject(project);
        fileset.setProject(project);