users@jaxb.java.net

Re: Customization help needed

From: Belliveau, Francis - 0995 - MITLL <belliveau_at_ll.mit.edu>
Date: Tue, 23 Feb 2010 16:13:40 -0500

Thanks to all for the help.

It took a bit to get the Value-Constructor plugin to work. It seems that
the documentation there is older than the mechanism I need to specify the
JAR and enabling argument. There is also a plugin for toString() so those
specific cases have been handled.

It looks like the solution to other problems will be to write a custom
plugin and create some new tags for it to work with.

For the readers who would like to know what was wrong with the
documentation, I have the following to say:

  * Do not use classpath definitions to the JVM, use ³­classpath²
argument(s) to XJC to define the plugin JAR file(s).
  * The additional argument to enable the plugin call was correct.

The documentation originally lead me to believe that my ANT script should
look something like:

  <java classname="com.sun.tools.xjc.XJCTask" fork="true">
    <classpath>
      <pathelement path="../jars/jaxb-xjc.jar"/>
      <pathelement
path="../jars/jaxb-2.0-xjc-value-constructor-plugin-snapshot.jar"/>
    </classpath-->
    <arg value="-Xvalue-constructor"/>
  ...

When what I really needed was:

    <java jar="../jars/jaxb-xjc.jar" fork="true">
        <arg value="-classpath"/>
        <arg
value="../jars/jaxb-2.0-xjc-value-constructor-plugin-snapshot.jar"/>
        <arg value="-Xvalue-constructor"/>
  ...

Fran