Oops, apparently those annotations created by XJC already have the
RetentionPolicy.RUNTIME; once I corrected errors in my use of reflection
I am finding the annotations I was looking for.
Thanks anyway!
Larry
On 12/15/2010 1:18 PM, Larry Talley wrote:
> 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.
>
> 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.
>
> Is there a way to ask JAXB to generate annotations with a
> RetentionPolicy.RUNTIME, or, is there a better approach?
>
> Larry Talley