« Return to Thread: Java classes generation problem with JAXB

Java classes generation problem with JAXB

by metro-3 :: Rate this Message:

Reply to Author | View in Thread

I am trying to generate Java classes from an xsd file using JAXB and have two questions.

1) I have this xsd definition where I define a complexType that contains a list.

<xs:complexType name="person">
  <xs:sequence>
    <xs:element name="full_name" type="xs:string"/>
    <xs:element name="child_name" type="xs:string" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
 
The question is why the setter is not being generated ?
In the example, the generated Java class doesn't contain the setter method for child_name list.

2) I have this other complexType definition.

  <xs:complexType name="Name">
          <xs:sequence maxOccurs="unbounded">
            <xs:element name="First" type="xs:string"/>
            <xs:element name="Middle" type="xs:string" minOccurs="0" />
            <xs:element name="Last" type="xs:string"/>
            <xs:element name="Initials" minOccurs="0" type="xs:string"/>
          </xs:sequence>
    </xs:complexType>
The generated Java class has only one attribute named: firstAndMiddleAndLast.
Is there any way or configuration that I can do to set another name for this attribute without using the binding .xjb file?

thanks a lot!!
[Message sent by forum member 'pferreyra' (pferreyra)]

http://forums.java.net/jive/thread.jspa?messageID=354529

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Java classes generation problem with JAXB