// get all the classes
JavaClass[] classes = manager.getAllClasses();
for (int i = 0; i < classes.length; i++) {
JavaClass clazz = classes[i];
try {
AttributeEnhancer enhancer = new BcelAttributeEnhancer();
if (enhancer.initialize(clazz.getFullyQualifiedName(), classPath)) {
handleClassAnnotations(manager, enhancer, clazz);
handleInnerClassAnnotations(manager, enhancer, clazz, classPath, destDir);
JavaMethod[] methods = clazz.getMethods();
for (int j = 0; j < methods.length; j++) {
handleMethodAnnotations(manager, enhancer, methods[j]);
}
JavaField[] fields = clazz.getFields();
for (int j = 0; j < fields.length; j++) {
handleFieldAnnotations(manager, enhancer, fields[j]);
}
// write enhanced class to disk
enhancer.write(destDir);
}
} catch (Throwable e) {
e.printStackTrace();
logWarning(
"could not compile annotations for class [" + clazz.getFullyQualifiedName() + "] due to: "