Methods Summary |
---|
public java.lang.Class | getCheckClass()Get the comparison class.
return clazz;
|
public java.lang.String | getType()Get the comparison type.
return type;
|
public java.lang.String | getURI()Get the type's URI.
return uri;
|
public boolean | isSelected(org.apache.tools.ant.types.Resource r)Return true if this Resource is selected.
if ((clazz == null) == (type == null)) {
throw new BuildException(ONE_ONLY);
}
Class c = clazz;
if (type != null) {
if (project == null) {
throw new BuildException(
"No project set for InstanceOf ResourceSelector; "
+ "the type attribute is invalid.");
}
AntTypeDefinition d = ComponentHelper.getComponentHelper(
project).getDefinition(ProjectHelper.genComponentName(uri, type));
if (d == null) {
throw new BuildException("type " + type + " not found.");
}
try {
c = d.innerGetTypeClass();
} catch (ClassNotFoundException e) {
throw new BuildException(e);
}
}
return c.isAssignableFrom(r.getClass());
|
public void | setClass(java.lang.Class c)Set the class to compare against.
if (clazz != null) {
throw new BuildException("The class attribute has already been set.");
}
clazz = c;
|
public void | setProject(org.apache.tools.ant.Project p)Set the Project instance for this InstanceOf selector.
project = p;
|
public void | setType(java.lang.String s)Set the Ant type to compare against.
type = s;
|
public void | setURI(java.lang.String u)Set the URI in which the Ant type, if specified, should be defined.
uri = u;
|