if (ref == null) {
throw new BuildException("No reference specified for isreference "
+ "condition");
}
Object o = getProject().getReference(ref.getRefId());
if (o == null) {
return false;
} else if (type == null) {
return true;
} else {
Class typeClass =
(Class) getProject().getDataTypeDefinitions().get(type);
if (typeClass == null) {
typeClass =
(Class) getProject().getTaskDefinitions().get(type);
}
if (typeClass == null) {
// don't know the type, should throw exception instead?
return false;
}
return typeClass.isAssignableFrom(o.getClass());
}