See [1] for AnnotationReader interface.
Mark Hansen wrote:
> Its an interesting idea that I'd like to explore - time permitting.
> But, what would you use to take the place of XPath? I mean, what
> language construct to you have to associate external annotations with
> methods, fields, etc. in the Java class definition?
You have to come with one. One obvious idea would be to use some XML
format, like:
<package name="org.acme.foo" xmlns:jaxb="javax.xml.bind.annotations">
<class name="Point">
<field name="x">
<jaxb:XmlElement name="foo" />
</field>
...
Methods are harder because you need to be able to disambiguate
overloaded methods, but I think with reasonable defaulting I'm sure it
can be made to work.
[1]
https://www.dev.java.net/source/browse/jaxb2-sources/jaxb-ri/runtime/src/com/sun/xml/bind/v2/model/annotation/AnnotationReader.java?rev=1.4&view=markup
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com