dragome/dragome-sdk

Annotations on Methods

Closed this issue · 5 comments

Is there a dragome way to get to the annotations defined for a method?

There is a non standard mechanism provided for reading type annotations but it's not implemented for methods yet:

public static AnnotationContainer getAnnotationsByType(Class<? extends Annotation> aType)
{
AnnotationContainer annotationContainer= annotationsByType.get(aType);
if (annotationContainer == null)
annotationsByType.put(aType, annotationContainer= new AnnotationContainer());
return annotationContainer;
}

Thanks for the tip but I thought getDeclaredAnnotations method in Class is implemented. At least, there is a code for it. Should we use AnnotationHelper instead?

https://github.com/dragome/dragome-sdk/blob/master/dragome-js-jre/src/main/java/java/lang/Class.java#L342

Until I finished standard annotation mechanism implementation it's the only way the get that info

Initial support for annotations added: a8c8a05
Now we can read annotations from classes, methods and method parameters.
Tests for these new reflection features here: dragome/dragome-examples@d6794f2

I was wondering what does the code used in getDeclaredAnnotations in Class.java do?