Hi there,
One class is the bean (get/sets).
The other is a subclass that is only generated if it is not there (ie: not
overwritten).
This allows you to put custom logic in overridden method in the subclass. Then
when you regenerate, you won't loose anything. If you put code into
ExtraDataType, then you would loose it upon re-generation.
Hope this helps!
Sam
On Friday 26 September 2003 15:14, [EMAIL PROTECTED] wrote:
> When I generate source code using the SourceGenerator, I get TWO classes
> for the extraData element:
>
> ExtraData and ExtraDataType
>
> ExtraData is a subclass of ExtraDataType.
>
> Why is it generating two classes instead of just one? There doesn't seem
> to be any reason. ExtraData doesn't have any new methods or fields. The
> methods that it does have for marshalling are identical to the ones in the
> super or parent class. Is this a bug in the SourceGenerator, a design
> problem with our schema or a workaround for some Java language limitation?
>
> Here's a snippet of the schema that has been sanitized a bit:
>
>
> <xsd:complexType name="listType">
> <xsd:sequence>
> <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="extraData" type="extraDataType" minOccurs="1"
> maxOccurs="1"/>
> </xsd:sequence>
> <xsd:attribute name="itemID" type="xsd:ID" use="required"/>
> <xsd:attribute name="label" type="xsd:string" use="optional"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
>
> <xsd:complexType name="extraDataType">
> <xsd:sequence>
> <xsd:element name="company" type="xsd:string" minOccurs="1"
> maxOccurs="unbounded"/>
> <xsd:element name="person" type="xsd:string" minOccurs="1"
> maxOccurs="unbounded"/>
> </xsd:sequence>
> <xsd:attribute name="ID" type="xsd:ID" use="required"/>
> </xsd:complexType>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev