Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Annotations for shared super class attributes and associations?(Is it possible to setup annotations that are variable depending on context?)
icon5.gif  Annotations for shared super class attributes and associations? [message #666804] Fri, 22 April 2011 12:54
DavidH Mising name is currently offline DavidH Mising name
Messages: 3
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.
Previous Topic:ECore Meta-Model to XMI Transform Issue: Re-used Entities Only Take Last Map
Next Topic: AML(AtlanMod Matching Language )
Goto Forum:
  


Current Time: Thu Jul 31 05:43:43 EDT 2014

Powered by FUDForum. Page generated in 0.01454 seconds