users@jaxb.java.net

Re: Specifying Interfaces that generated classes extend/implement

From: Malachi de AElfweald <malachi_at_EOTI.ORG>
Date: Thu, 06 Mar 2003 10:36:24 -0700

On Thu, 6 Mar 2003 18:33:52 +0100, Marek Malowidzki <maom_onet_at_poczta.onet.pl> wrote:

>My example is more complex:
>
> <xsd:complexType name="ColumnTemplate">
> <xsd:sequence>
> <xsd:group ref="EntryTemplate"/>
> <xsd:group ref="VariableValue"/>
> </xsd:sequence>
> <xsd:attributeGroup ref="ColumnExtAttributeGroup"/>
> </xsd:complexType>
>
> <xsd:complexType name="VariableTemplate">
> <xsd:sequence>
> <xsd:group ref="EntryTemplate"/>
> <xsd:group ref="VariableValue"/>
> </xsd:sequence>
> <xsd:attribute name="group" type="xsd:IDREF"/>
> <xsd:attribute name="rows" type="PositiveShort"/>
> <xsd:attribute name="max-access" type="MaxAccess"/>
> <xsd:attribute name="show" type="xsd:boolean" default="true"/>
> </xsd:complexType>
>
>I would like both types to include all methods generated for the two groups of
>elements and for one of attributes (which is also present in
>ColumnExtAttributeGroup). Using pseudo-code, I would like my generated Java
>classes to implement the following interface:
>
>interface Common {
> EntryTemplate methods
> VariableValue methods
> attribute max-access
>}

Ok, what about this?
1) make a new type that has the sequence and max-access
2) make ColumnTemplate extend that type (#1) to include the ColumnExtAttributeGroup
3) make VariableTemplate extend that type (#1) and add the 3 attributes
4) remove max-access from ColumnExtAttributeGroup
5) if ColumnExtAttributeGroup is used anywhere else, then make a new type that extends ColumnExtAttributeGroup and includes max-access

I know that looks like a lot of changes, but wouldn't that do what you want?

Malachi