FileDocCategorySizeDatePackage
Type.javaAPI DocApache Ant 1.702910Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types.resources.selectors

Type

public class Type extends Object implements ResourceSelector
Type file/dir ResourceSelector.
since
Ant 1.7

Fields Summary
private static final String
FILE_ATTR
private static final String
DIR_ATTR
public static final Type
FILE
Static file type selector.
public static final Type
DIR
Static dir type selector.
private FileDir
type
Constructors Summary
public Type()
Default constructor.


           
      
    
public Type(FileDir fd)
Convenience constructor.

param
fd the FileDir type.

        setType(fd);
    
Methods Summary
public booleanisSelected(org.apache.tools.ant.types.Resource r)
Return true if this Resource is selected.

param
r the Resource to check.
return
whether the Resource was selected.

        if (type == null) {
            throw new BuildException("The type attribute is required.");
        }
        int i = type.getIndex();
        return r.isDirectory() ? i == 1 : i == 0;
    
public voidsetType(org.apache.tools.ant.types.resources.selectors.Type$FileDir fd)
Set type; file|dir.

param
fd a FileDir object.

        type = fd;