users@jaxb.java.net

Re: JAXB/XJC generated annotations and xs:documentation

From: Pierre Lecesne <pierre.lecesne_at_gmail.com>
Date: Mon, 26 Apr 2010 01:23:18 +0200

Hi,

Ok, thanks to a good amount of time in debug with the *XSVisitor*, I managed
to get all the information I needed.
The only issue which remains is to find the link between the schema
definition and the generated class :

Let's say I stored in a map the *xs:documentation* value of my element
"book-name". How can I know that this element "book-name" corresponds to the
java attribute "bookName" (the name being different).
The* XSSchema* object (and all its tree) seems to know only the element
"book-name" and the *ClassOutline *object, only the "bookName" attribute.
What can help me making the link between the two ?

I hope I was clear enough on my issue :-/
Thank you!

-- Pierre

On Sun, Apr 25, 2010 at 03:03, plecesne <pierre.lecesne_at_gmail.com> wrote:

>
> 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>