|
|
|
@@ -26,11 +26,34 @@ import org.apache.tools.ant.types.EnumeratedAttribute; |
|
|
|
*/ |
|
|
|
public class Type implements ResourceSelector { |
|
|
|
|
|
|
|
private static final String FILE_ATTR = "file"; |
|
|
|
private static final String DIR_ATTR = "dir"; |
|
|
|
|
|
|
|
/** Static file type selector. */ |
|
|
|
public static final Type FILE = new Type(new FileDir(FILE_ATTR)); |
|
|
|
|
|
|
|
/** Static dir type selector. */ |
|
|
|
public static final Type DIR = new Type(new FileDir(DIR_ATTR)); |
|
|
|
|
|
|
|
/** |
|
|
|
* Implements the type attribute. |
|
|
|
*/ |
|
|
|
public static class FileDir extends EnumeratedAttribute { |
|
|
|
private static final String[] VALUES = new String[] {"file", "dir"}; |
|
|
|
private static final String[] VALUES = new String[] {FILE_ATTR, DIR_ATTR}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Default constructor. |
|
|
|
*/ |
|
|
|
public FileDir() { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Convenience constructor. |
|
|
|
* @param value the String EnumeratedAttribute value. |
|
|
|
*/ |
|
|
|
public FileDir(String value) { |
|
|
|
setValue(value); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Return the possible values. |
|
|
|
@@ -43,6 +66,20 @@ public class Type implements ResourceSelector { |
|
|
|
|
|
|
|
private FileDir type = null; |
|
|
|
|
|
|
|
/** |
|
|
|
* Default constructor. |
|
|
|
*/ |
|
|
|
public Type() { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Convenience constructor. |
|
|
|
* @param fd the FileDir type. |
|
|
|
*/ |
|
|
|
public Type(FileDir fd) { |
|
|
|
setType(fd); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Set type; file|dir. |
|
|
|
* @param fd a FileDir object. |
|
|
|
|