-
Feature Request
-
Resolution: Done
-
Major
-
1.0.6.Final
-
None
Currently, if presented with a Java file like this:
public class MockAnnotatedMethod {
@MockAnnotation( anAnnotation = @AnotherMockAnnotation(43)),
public MockAnnotatedMethod() {
}
}
JavaSource can easily parse @MockAnnotation into org.jboss.forge.parser.java.Annotation. But then calling...
annotationSource.getLiteralValue("anAnnotation")
...results in the String...
"@AnotherMockAnnotation(43)"
There doesn't appear to be a good way to parse this String into another org.jboss.forge.parser.java.Annotation, complete with initializing its value to be '43'.
This is needed for Metawidget. Metawidget's inspectors can be written to inspect arbitrary metadata. It is feasible (though not currently required) that someone might want to parse:
@AttributeOverride( name = "name", column = @Column( name = "name", nullable = false ) )
public class Person {
...
}
This is a JPA annotation that makes the 'name' field a 'required' field, but to do so it uses nested annotations.