|
AboutThisProject
usage also described
IntroductionAt our company we use xsd's to generate DTO objects. Later on this objects can be used in different contexts: WS, BlazeDS, Json etc... Ususaly we perform generation using maven-jaxb2-plugin. Recently we came across one problem using generated code with BlazeDS: boolean fields can only have isXXX getters. There is no way to force maven-jaxb2-plugin to generate getXXX for boolean. Unfortunately because of this you cannot get booean values from flex side. To solve this problem we put to gether small plugin for maven-jaxb2-plugin, that adds getXXX getters for booleans, isXXX are also left in order not to break existing code that uses them. UsageThis plugin is activated by adding: <arg>-Xboolean-getter</arg> and <plugin> <groupId>com.nebulent.xjc</groupId> <artifactId>boolean-getter</artifactId> <version>0.5</version> </plugin> to maven-jaxb2-plugin configuration. Example
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<extension>true</extension>
<args>
<arg>-Xcollection-setter-injector</arg>
<arg>-Xboolean-getter</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>collection-setter-injector</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>com.nebulent.xjc</groupId>
<artifactId>boolean-getter</artifactId>
<version>1.0</version>
</plugin>
</plugins>
<schemaLanguage>XMLSCHEMA</schemaLanguage>
<schemaIncludes>
<value>XXX.xsd</value>
</schemaIncludes>
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
<bindingDirectory>${basedir}/src/main/resources</bindingDirectory>
<generateDirectory>target/generated-sources</generateDirectory>
<forceRegenerate>true</forceRegenerate>
<bindingIncludes>
<include>*.xjb</include>
</bindingIncludes>
</configuration>
</plugin>
|