final JavaClass javaClass = getJavaClassFromResource(resource);
return javaClass.hasAnnotation(annotationClass);
}
else if (resource instanceof JavaMemberResource)
{
final JavaMemberResource javaMemberResource = (JavaMemberResource) resource;
return javaMemberResource.getUnderlyingResourceObject().hasAnnotation(annotationClass);
}
throw new IllegalArgumentException("The given resource '" + resource.getName() + "' is not a Java resource");
}