users@jaxb.java.net

Re: Customization namespaces and "vendor extensions"

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 18 Jan 2005 09:54:53 -0800

Rune Peter Bjørnstad wrote:
> By accessing a generated classes JavaDoc, and parsing it using my “vendor
> extension?, I’m able to generate classes that adapts to my needs. This is
> all fine and dandy, but I’m currently investigating how this can be done
> more elegantly. The following XML Schema annotation is the notation I would
> like to be able to use:

I see. That makes sense.

> Does to the JAXB RI provide “hooks? for providing vendor customization
> namespaces, which can be use din order to customize class creation? The
> example above is just used to demonstrate what I would like to do. I am
> aware that the result can be achieved using current RI customization
> features, but this is not the object of my question.

Today, it doesn't. But this is something I'm interested in integrating
into 2.0.

Allowing an extension to participate in the parsing of annotation is
relatively easy. We can accept your ContentHandler and namespace URI of
your extension, and then I can feed annotations to you.

The hard part to me is to associate your parsed annotations back to the
model we build. XML Schema defines a lot more annotation points than
JAXB can meaningfully differentiate.

For example, knowing nothing about the semantics of your extension, what
shall the RI do if it sees your annotation on, say, <xs:include>? Or
say, if your annotation is on <xs:complexType>. The RI can be hard-coded
to pass such an annotation onto a ClassContext/ClassItem.

It would help me a lot if you can tell me more about where do you plan
to allow your annotations and in which model object you'd like to see them.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net