users@jaxb.java.net

Re: JAXB/XJC generated annotations and xs:documentation

From: plecesne <pierre.lecesne_at_gmail.com>
Date: Sat, 24 Apr 2010 18:03:20 -0700 (PDT)

Dear all,

I got interested in JAXB plugins today as I was trying to turn xsd
annotations into a java annotation.
The same way Lucas did, I managed to retrieve the xsd:documentation part of
the complex type, but still not the xsd:documentation part of the elements
contained by this complex type.

I wonder why there would be an API to get one and not the other one, so I
wanted to know if someone has figured this out since last year.

Thank you!

-- Pierre


Hi,

I have a schema that I'm successfully compiling and using with XJC. I'm
wondering if I can utilize the schema xs:documentation tags as
annotations in the generated Java code. For instance, I'd like to see
something like the following java code from the following schema snippet.

I've attempted to write an xjc plugin that iterates through classes and
finds documentation via
ClassOutline.target.getSchemaComponent().getAnnotation().getAnnotation().getDocumentation(),
but I can't get the lang attribute that way and I can't seem to figure
out how to do the same thing for fields. I've also looked at the
annotate commons project, but it only deals with custom appinfo.

Additionally, is there a better way to do this? Am I missing something
painfully obvious? :)

Thanks,
Lucas Madar

-- 
View this message in context: http://old.nabble.com/JAXB-XJC-generated-annotations-and-xs%3Adocumentation-tp23453637p28353833.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.