private void addTransformsToClassNode(AnnotationNode annotation, Annotation transformClassAnnotation) {
String[] transformClassNames = getTransformClassNames(transformClassAnnotation);
Class[] transformClasses = getTransformClasses(transformClassAnnotation);
if(transformClassNames.length == 0 && transformClasses.length == 0) {
source.getErrorCollector().addError(new SimpleMessage("@GroovyASTTransformationClass in " +
annotation.getClassNode().getName() + " does not specify any transform class names/classes", source));
}
if(transformClassNames.length > 0 && transformClasses.length > 0) {
source.getErrorCollector().addError(new SimpleMessage("@GroovyASTTransformationClass in " +
annotation.getClassNode().getName() + " should specify transforms only by class names or by classes and not by both", source));
}
for (String transformClass : transformClassNames) {
try {
Class klass = transformLoader.loadClass(transformClass, false, true, false);
verifyClassAndAddTransform(annotation, klass);
} catch (ClassNotFoundException e) {
source.getErrorCollector().addErrorAndContinue(
new SimpleMessage(
"Could not find class for Transformation Processor " + transformClass
+ " declared by " + annotation.getClassNode().getName(),
source));
}
}