users@jaxb.java.net

Re: JAXB customization to generate flat (less hierarchal) Java class

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Thu, 23 Apr 2009 16:32:33 +0200

This goes into the outermost <jaxb:bindings> element of your external
binding file:

<jaxb:bindings ...
 xmlns:ci="http://jaxb.dev.java.net/plugin/code-injector" >

Locating the type in the usual way, you add the code you want to insert:

<jaxb:bindings node="//xsd:complexType[@name='Car']">
<ci:code>><![CDATA[
    public String getEngine() { ... }
]]>
 </ci:code>
</jaxb:bindings>

Call xjc from some JAXB release:

java -jar $JAXB_HOME/lib/jaxb-xjc.jar -extension -Xinject-code -b xxx.xjb
xxx.xsd

-W


On Thu, Apr 23, 2009 at 12:13 PM, dhai <sdhari_at_hotmail.com> wrote:

>
> thanks for reply.
>
> Can you please elaborate this? Sorry I am new to JABX. I have used external
> JABX customization for change Java types.
>
> --
> View this message in context:
> http://www.nabble.com/JAXB-customization-to-generate-flat-%28less-hierarchal%29-Java-class-tp23191755p23194041.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
>
>