getting package annotation

35 views
Skip to first unread message

Alexandre Russel

unread,
Jul 4, 2013, 9:10:25 AM7/4/13
to google-code...@googlegroups.com
Hi,

 would someone have some code that shows how to get the following annotation in a package-info.java:
---- start package-info.java
@Narrative(
        title = "title",
        type = "Feature"
)
package a.b.c

import foo.Narrative;
----- end package-info.java


Alex

Alexandre Russel

unread,
Jul 4, 2013, 9:32:19 AM7/4/13
to google-code...@googlegroups.com
Using Package.getPackage("a.b.c").get... isn't too much code, so actually an helper that could list the packages starting with 'a' would be a good start.

Alex


--
You received this message because you are subscribed to a topic in the Google Groups "google-code-reflections" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-code-reflections/2mCB-TGBAo8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-code-refle...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexandre Russel

unread,
Jul 5, 2013, 3:06:27 PM7/5/13
to google-code...@googlegroups.com
Answering my own question:
reflections.getTypesAnnotatedWith(Narrative.class)
will return a Class with name a.b.c.package-info and on which I can get the Annotation

Alex
Reply all
Reply to author
Forward
0 new messages