I'm using this code to get Java Class annotation:
JavaClass jclas = new ClassParser("src\\test\\org\\poc\\TestClass.class").parse();
ClassGen cg = new ClassGen(jclas);
AnnotationEntryGen[] attributes = cg.getAnnotationEntries();
for (AnnotationEntryGen attribute : attributes) {
System.out.println("attribute: " + attribute);
if(attribute.getTypeName().contains("Fix")) {
// Do something
}
}
But when I print attribute.getTypeName()
I get Lorg/annotations/Fix
. The annotation name is @Fix(..)
Do you know how I can get only the name?