Annotations for shared super class attributes and associations? [message #666804] |
Fri, 22 April 2011 12:54 |
DavidH Messages: 2 Registered: April 2011 |
Junior Member |
|
|
Suppose I have an abstract ECore meta-class called Cardinality with two integer attributes:
min:: EInt
max:: EInt
I have two subclasses that utilize the cardinality attributes:
ProductComposition extends Cardinality
RequestSpecificationComposition extends Cardinality
But the output XMI needs to use different tags to represent these instances as follows:
<xsd:complexType name="ProductComposition">
<xsd:sequence>
<xsd:element name="MaximumNumberOfComponents" type="xsd:integer" minOccurs="0"/>
<xsd:element name="MinimumNumberOfComponents" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="RequestSpecificationComposition">
<xsd:sequence>
<xsd:element name="MaximumNumberOfRequests" type="xsd:integer" minOccurs="0"/>
<xsd:element name="MinimumNumberOfRequests" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
How can I use annotations to vary the output format based on the subclass that uses the common super class attributes? The attributes are only defined once...so I can only place one Annotation on each attribute.
|
|
|
Powered by
FUDForum. Page generated in 0.01570 seconds