Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

CXF XJC Boolean Getter Plugin

The CXF XJC Boolean Getter Plugin provides and XJC plugin that updates the generated beans to change the boolean getter methods from "isFoo()" to "getFoo()". This is useful when integrating with certain other applications that use simple BeanInfo reflection to determine the properties.

For example, if the schema contains:

Code Block
xml
xml
<xs:complexType name="Foo">
  	<xs:sequence>
	    <xs:element name="value" type="xs:boolean"/>
   </xs:sequence>
</xs:complexType>

it would generate getter methods like:

Code Block
java
java
    public boolean getValue() {
        return value;
    }

Instead of the default method of:

Code Block
java
java
    public boolean isValue() {
        return value;
    }

To use with Maven

Code Block
xml
xml
           <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>xsdtojava</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <xsdOptions>
                        <xsdOption>
                            <extension>true</extension>
                            <xsd>${basedir}/src/main/resources/schemas/configuration/foo.xsd</xsd>
                            <extensionArgs>
                                <arg>-Xbg</arg>
                            </extensionArgs>
                        </xsdOption>
                    </xsdOptions>
                    <extensions>
                        <extension>org.apache.cxf.xjcplugins:cxf-xjc-boolean:2.3.0</extension>
                    </extensions>
                </configuration>
            </plugin>