You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mathieu Godlewski (JIRA)" <ji...@apache.org> on 2014/12/08 14:51:12 UTC
[jira] [Closed] (CXFXJC-9) Default value plugin doesn't handle
boolean type
[ https://issues.apache.org/jira/browse/CXFXJC-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mathieu Godlewski closed CXFXJC-9.
----------------------------------
Resolution: Implemented
Taking a look at the dv-test sources, I see that minOccurs="0" is mandatory to handle boolean type default value.
In my wsdl, this declaration works
{code:xml}
<xsd:element name="handsetCompatibility" type="xsd:boolean" default="true" minOccurs="0" maxOccurs="1"/>
{code}
Works in 2.4.0 and perhaps in earlier versions
> Default value plugin doesn't handle boolean type
> ------------------------------------------------
>
> Key: CXFXJC-9
> URL: https://issues.apache.org/jira/browse/CXFXJC-9
> Project: CXF XJC Utils
> Issue Type: Bug
> Affects Versions: 3.0.3
> Reporter: Mathieu Godlewski
>
> Hello,
> The default value plugin doesn't work with boolean value :
> Extract of my wsdl :
> {code:xml}
> <xsd:element name="handsetCompatibility" type="xsd:boolean" maxOccurs="1" minOccurs="1"/>
> {code}
> Generated code :
> {code:java}
> @XmlElement(defaultValue = "true")
> protected boolean handsetCompatibility;
> public boolean isHandsetCompatibility() {
> return handsetCompatibility;
> }
> public void setHandsetCompatibility(boolean value) {
> this.handsetCompatibility = value;
> }
> {code}
> Maven plugin declaration :
> {code:xml}
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <version>3.0.2</version>
> <executions>
> <execution>
> <id>generate-sources</id>
> <phase>generate-sources</phase>
> <configuration>
> <defaultOptions>
> <extraargs>
> <extraarg>-xjc-Xfluent-api</extraarg>
> <extraarg>-xjc-Xdv</extraarg>
> </extraargs>
> </defaultOptions>
> <sourceRoot>${basedir}/src/main/java</sourceRoot>
> <wsdlOptions>
> <wsdlOption>
> <wsdl>${basedir}/src/main/resources/xxx.wsdl</wsdl>
> <extraargs>
> <extraarg>-impl</extraarg>
> <extraarg>-verbose</extraarg>
> </extraargs>
> <bindingFiles>
> <bindingFile>${basedir}/src/main/resources/binding.xml</bindingFile>
> </bindingFiles>
> </wsdlOption>
> </wsdlOptions>
> </configuration>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> <dependencies>
> <dependency>
> <groupId>org.apache.cxf.xjcplugins</groupId>
> <artifactId>cxf-xjc-dv</artifactId>
> <version>3.0.3</version>
> </dependency>
> </dependencies>
> </plugin>
> {code}
> Work weel for String type.
> Regards,
> Mathieu
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)