Methods Summary |
---|
public boolean | isSelected(java.io.File basedir, java.lang.String filename, java.io.File file)The heart of the matter. This is where the selector gets to decide
on the inclusion of a file in a particular fileset.
// throw BuildException on error
validate();
if (file.isDirectory()) {
return type.equals(FileType.DIR);
} else {
return type.equals(FileType.FILE);
}
|
public void | setParameters(org.apache.tools.ant.types.Parameter[] parameters)When using this as a custom selector, this method will be called.
It translates each parameter into the appropriate setXXX() call.
super.setParameters(parameters);
if (parameters != null) {
for (int i = 0; i < parameters.length; i++) {
String paramname = parameters[i].getName();
if (TYPE_KEY.equalsIgnoreCase(paramname)) {
FileType t = new FileType();
t.setValue(parameters[i].getValue());
setType(t);
} else {
setError("Invalid parameter " + paramname);
}
}
}
|
public void | setType(org.apache.tools.ant.types.selectors.TypeSelector$FileType fileTypes)Set the type of file to require.
this.type = fileTypes.getValue();
|
public java.lang.String | toString()
StringBuffer buf = new StringBuffer("{typeselector type: ");
buf.append(type);
buf.append("}");
return buf.toString();
|
public void | verifySettings()Checks to make sure all settings are kosher. In this case, it
means that the pattern attribute has been set.
if (type == null) {
setError("The type attribute is required");
}
|