Hi,
> I would like to have runtime access (via reflection) to the Java annotations
> written for me by XJC. I haven't seen a way to tell XJC that I want
> RententionPolicy.RUNTIME for those annotations.
JAXB annotations are per se @Retention(RUNTIME). How do you think JAXB
would read them in runtime if they were not?
You can use something like
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder to read JAXB model
from the annotated classes in the runtime - you don't have to process
all the annotations yourself.
> Or perhaps there are other ways to accomplish my objective.
>
> At runtime I want to interrogate objects that have been unmarshalled from
> XML, and treat those objects that were defined in the schema as xs:date
> slightly differently than those that were in the schema as xs:dateTime. If
> I could get RetentionPolicy.RUNTIME set for the JAXB annotations, I could
> use that to differentiate.
I am not sure you'll accomplish this with runtime, annotations don't
always contain type information.
Bye,
/lexi