You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "kombi (JIRA)" <ji...@apache.org> on 2007/11/13 05:24:50 UTC

[jira] Created: (CXF-1206) xjc dv plugin doesn't provide default values for complexTypes that contain elements

xjc dv plugin doesn't provide default values for complexTypes that contain elements
-----------------------------------------------------------------------------------

                 Key: CXF-1206
                 URL: https://issues.apache.org/jira/browse/CXF-1206
             Project: CXF
          Issue Type: Test
    Affects Versions: 2.1
         Environment: MacOSX, Java1.5
            Reporter: kombi
         Attachments: cxf-xjc-dv-test.patch

I created a test case to test this situation:

    <xs:complexType name="pageColor">
    	<xs:sequence>
    		<xs:element name="background" type="xs:string" default="red"/>
    		<xs:element name="foreground" type="xs:string" default="blue"/>
    	</xs:sequence>
    </xs:complexType>

<xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>

The defaults values are never set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1206) xjc dv plugin doesn't provide default values for complexTypes that contain elements

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542051 ] 

maomaode commented on CXF-1206:
-------------------------------

The default value is generated on the PageColor, 

    @XmlElement(required = true, defaultValue = "red")
    protected String background;
    @XmlElement(required = true, defaultValue = "blue")
    protected String foreground;

the problem is that the PageColor is null if you try to get the instance of the PageColor from the Foo

assertNull(foo.getPageColor()); 

> xjc dv plugin doesn't provide default values for complexTypes that contain elements
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-1206
>                 URL: https://issues.apache.org/jira/browse/CXF-1206
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.1
>         Environment: MacOSX, Java1.5
>            Reporter: kombi
>         Attachments: cxf-xjc-dv-test.patch
>
>
> I created a test case to test this situation:
>     <xs:complexType name="pageColor">
>     	<xs:sequence>
>     		<xs:element name="background" type="xs:string" default="red"/>
>     		<xs:element name="foreground" type="xs:string" default="blue"/>
>     	</xs:sequence>
>     </xs:complexType>
> <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
> The defaults values are never set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-1206) xjc dv plugin doesn't provide default values for complexTypes that contain elements

Posted by "kombi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

kombi updated CXF-1206:
-----------------------

    Attachment: cxf-xjc-dv-test.patch

Patch created from cxf/common/cxf/src

> xjc dv plugin doesn't provide default values for complexTypes that contain elements
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-1206
>                 URL: https://issues.apache.org/jira/browse/CXF-1206
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.1
>         Environment: MacOSX, Java1.5
>            Reporter: kombi
>         Attachments: cxf-xjc-dv-test.patch
>
>
> I created a test case to test this situation:
>     <xs:complexType name="pageColor">
>     	<xs:sequence>
>     		<xs:element name="background" type="xs:string" default="red"/>
>     		<xs:element name="foreground" type="xs:string" default="blue"/>
>     	</xs:sequence>
>     </xs:complexType>
> <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
> The defaults values are never set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-1206) xjc dv plugin doesn't provide default values for complexTypes that contain elements

Posted by "maomaode (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

maomaode resolved CXF-1206.
---------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.4
         Assignee: maomaode

> xjc dv plugin doesn't provide default values for complexTypes that contain elements
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-1206
>                 URL: https://issues.apache.org/jira/browse/CXF-1206
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.1
>         Environment: MacOSX, Java1.5
>            Reporter: kombi
>            Assignee: maomaode
>             Fix For: 2.0.4
>
>         Attachments: cxf-xjc-dv-test.patch
>
>
> I created a test case to test this situation:
>     <xs:complexType name="pageColor">
>     	<xs:sequence>
>     		<xs:element name="background" type="xs:string" default="red"/>
>     		<xs:element name="foreground" type="xs:string" default="blue"/>
>     	</xs:sequence>
>     </xs:complexType>
> <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
> The defaults values are never set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-1206) xjc dv plugin doesn't provide default values for complexTypes that contain elements

Posted by "maomaode (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-1206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12542089 ] 

maomaode commented on CXF-1206:
-------------------------------

OK, I got this fixed, so now, if the complexType(PageColor) has default value in it's child element(red, blue), then it's container(Foo) will have a default value for the pageColor(use the default constructor)

Basically,  in Foo, the field

    protected PageColor pageColor;

been changed to 

    protected PageColor pageColor = new PageColor();

make sense?

> xjc dv plugin doesn't provide default values for complexTypes that contain elements
> -----------------------------------------------------------------------------------
>
>                 Key: CXF-1206
>                 URL: https://issues.apache.org/jira/browse/CXF-1206
>             Project: CXF
>          Issue Type: Test
>    Affects Versions: 2.1
>         Environment: MacOSX, Java1.5
>            Reporter: kombi
>         Attachments: cxf-xjc-dv-test.patch
>
>
> I created a test case to test this situation:
>     <xs:complexType name="pageColor">
>     	<xs:sequence>
>     		<xs:element name="background" type="xs:string" default="red"/>
>     		<xs:element name="foreground" type="xs:string" default="blue"/>
>     	</xs:sequence>
>     </xs:complexType>
> <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
> The defaults values are never set.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.