Please review the change to access the annotations from module-info
Mandy Chung
mandy.chung at oracle.com
Tue Apr 27 23:19:49 PDT 2010
Joe,
Thanks for the feedback to the ModuleInfo API. This change also
implements the reflection methods to access the annotations in the
java.lang.reflect.Module class (i.e. implementation of AnnotatedElement
methods).
The webrev is at:
http://cr.openjdk.java.net/~mchung/jigsaw/annotations/webrev/
Most of the work is done in the java.lang.module.ModuleInfoAnnotation
class that does the following:
- parses a raw annotation from the module-info.class
- stores the element value pairs
- creates an Annotation object using the core reflection
- it supports for both ModuleInfo and Module API to access annotations.
The Annotation objects created for the ModuleInfo.getAnnotation() method
doesn't support elements of Class type.
I added a constructor of CoreReflectionFactory to take a Module
parameter so that its module class loader will be used to load classes
when instantiating an Annotation object. Is there any issue with
that? The factory will only be used to parse class signatures.
Thanks
Mandy
More information about the jigsaw-dev
mailing list