Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » how to access classes that extends other classes
how to access classes that extends other classes [message #638310] Wed, 10 November 2010 14:13 Go to next message
Paulo Del Aguila is currently offline Paulo Del Aguila
Messages: 14
Registered: October 2010
Junior Member
Hi everybody. I describe my emf model with some classes then extends others classes. For example:

@gmf.diagram(foo="bar")
class Schema {
val SchemaElement[*] contents;
}

abstract class SchemaElement {
attr String name;
}

class Table extends SchemaElement {
attr Boolean isGeographic;
}

@gmf.node(label="name", border.width="2")
class Dimension extends Table {
@gmf.compartment(layout="list", collapsible="false")
val Attribute[*] dim_attributes;
}

Im doing m2t with egl, and i need to access all dimensions from schema for iterate..but how do this? Schema contains SchemaElement[*] contents;

[%for (i in Sequence{0..(schema.dimensions.size-1)}){%]

thanks for the aswers Smile
Re: how to access classes that extends other classes [message #638341 is a reply to message #638310] Wed, 10 November 2010 16:50 Go to previous messageGo to next message
Steffen Zschaler is currently offline Steffen Zschaler
Messages: 228
Registered: July 2009
Senior Member
How about using a select call and an isKindOf check?

[%for (d in schema.contents.select(se | se.isKindOf (Dimension))) {%]

Best regards,

Steffen

On 10/11/2010 19:14, Paulo Del Aguila wrote:
> Hi everybody. I describe my emf model with some classes then extends
> others classes. For example:
>
> @gmf.diagram(foo="bar")
> class Schema {
> val SchemaElement[*] contents;
> }
>
> abstract class SchemaElement {
> attr String name;
> }
>
> class Table extends SchemaElement {
> attr Boolean isGeographic;
> }
>
> @gmf.node(label="name", border.width="2")
> class Dimension extends Table {
> @gmf.compartment(layout="list", collapsible="false")
> val Attribute[*] dim_attributes;
> }
>
> Im doing m2t with egl, and i need to access all dimensions from schema
> for iterate..but how do this? Schema contains SchemaElement[*] contents;
>
> [%for (i in Sequence{0..(schema.dimensions.size-1)}){%]
>
> thanks for the aswers :)
>
Re: how to access classes that extends other classes [message #638355 is a reply to message #638341] Wed, 10 November 2010 19:05 Go to previous message
Paulo Del Aguila is currently offline Paulo Del Aguila
Messages: 14
Registered: October 2010
Junior Member
thank you very much Steffen, it resolves my problem, works fine Smile
Previous Topic:Multiple views on the same model
Next Topic:Using My own Java Code in ETL
Goto Forum:
  


Current Time: Mon Jul 28 16:35:28 EDT 2014

Powered by FUDForum. Page generated in 0.01978 seconds