Getter for Boolean properties with JAXB

I am trying to expose services using jax-ws, but the first surprise I got is that Weblogic does not support inner classes for request / response objects. After this situation here , I am faced with another task:

Create getXXX()instead of / in addition to the method isXXX().

I need to generate these methods when the service starts, I get the message:

<WS data binding error>could not find getter for property 'IsXXX' on com.foo.MyClass

Tried setting:

<jaxb:globalBindings generateIsSetMethod="false" enableJavaNamingConventions="false">

no effect .: (

Any help?

+5
source share
3 answers

BooleanGetter XJC JAXB http://fisheye5.cenqua.com/browse/~raw,r=1.1/jaxb2-commons/www/boolean-getter/index.html

JavaSE 6, - . http://forums.java.net/jive/message.jspa?messageID=319434

ant, :

    <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask" classpathref="development.classpath"/>

    <xjc schema="some.xsd" package="com.acme.jaxb" destdir="gen-src">
        <arg value="-Xcollection-setter-injector"/>  
        <arg value="-Xboolean-getter"/>
    </xjc>          

+1

, , jaxb 2.1.13 ( . JAXB-131). enableIntrospection xjc. xjc . org.codehause.mojo: jaxb2-maven-plugin: 1.3.1, . .

: -enableIntrospection

+6

, :

http://code.google.com/p/nebulent-xjc-booleangetter/wiki/AboutThisProject

It puts getXXX()addiotionally at the default value isXXX(), so code that already uses these classes does not break after applying the plugin.

+2
source

All Articles