Mark Hansen wrote:
> When I do "Start from Java" to generate XML Schema from an annotated
> POJO, I can use the @XmlJavaTypeAdapter to insert a custom type mapping.
>
> I can't see how to do the equivalent going the other way - "Start from
> XML". The <javaType> binding declaration seems to be only for atomic
> datatypes. While <property> seems to be restricted to substituting Java
> classes up/down the class hierarchy from the default class.
>
> In other words, can I use a binding declaration to map a schema type to
> an arbitrary POJO? Maybe not, I guess, because how would such a POJO
> get the proper annoations?
You are right. You can't do that today.
> So, is the only way to "Start from XML" and get to an existing POJO is
> to use the <dom> declaration and do the custom marshal from the
> resulting org.w3c.dom.Element inside the application code?
Sometimes you can generate the code once, and then take the ownership of
the code, and modify it to use some of your existing (annotated) POJOs.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com