cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathieu Godlewski (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXFXJC-9) Default value plugin doesn't handle boolean type
Date Mon, 08 Dec 2014 14:20:12 GMT

     [ https://issues.apache.org/jira/browse/CXFXJC-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mathieu Godlewski updated CXFXJC-9:
-----------------------------------
    Description: 
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 well for String type.
Regards,

Mathieu

  was:
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


> 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 well for String type.
> Regards,
> Mathieu



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message