Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » How to get relevant data from a Stereotype
icon5.gif  How to get relevant data from a Stereotype [message #654909] Thu, 17 February 2011 15:14 Go to next message
Bart Van Campenhout is currently offline Bart Van Campenhout
Messages: 9
Registered: February 2011
Junior Member
I'm wondering how to get to relevant data of a stereotype.
Take this piece of code for example:

private void appendAttrEGLClass(org.eclipse.edt.mof.egl.Element element, HashMap<String, String> attributes) {
if (element instanceof EGLClass) {
EGLClass x = (EGLClass) element;
attributes.put("xmlName", "eglClass");
attributes.put("fileName", x.getFileName());
if (x.getStereotype() != null){
attributes.put("stereoTypeToString", x.getStereotype().toString());
}
if (x.getSubType() != null){
attributes.put("subTypeToString", x.getSubType().toString());
}
}
}


Le'ts say that the "element" passed is an EGL Program of type BasicProgram.
How do get the "BasicProgram" out of the stereotype ?

Must parse through the slots myself ?
If so, is there a basic way of working with "slots" ?

Re: How to get relevant data from a Stereotype [message #654946 is a reply to message #654909] Thu, 17 February 2011 17:39 Go to previous messageGo to next message
Tim W Wilson is currently offline Tim W Wilson
Messages: 2
Registered: February 2011
Junior Member
The Part class has a method called getStereotype(). That will return to you the Stereotype instance you are looking for.

Cheers
Re: How to get relevant data from a Stereotype [message #654992 is a reply to message #654946] Thu, 17 February 2011 21:58 Go to previous messageGo to next message
Bart Van Campenhout is currently offline Bart Van Campenhout
Messages: 9
Registered: February 2011
Junior Member
Thx for the fast feedback.

The getStereotype() method I already found (as shown in my piece of code)

Now I'm wondering how to get the actual type of record/program/... from a Parts Stereotype.

The Stereotype class doesn't seem to provide any straight forward getters.
Should I use the eGet, getAnnotation or getMetadata for this ??

Do you have some clues for me concerning that ?
icon14.gif  Re: How to get relevant data from a Stereotype [message #656205 is a reply to message #654992] Thu, 24 February 2011 14:53 Go to previous message
Bart Van Campenhout is currently offline Bart Van Campenhout
Messages: 9
Registered: February 2011
Junior Member
on a Stereotype : getEClass.getName() returns "BasicProgram"
Previous Topic:EGL2IR uses old Cache of EGL Source
Next Topic:EDT wiki page
Goto Forum:
  


Current Time: Mon Sep 22 22:32:45 GMT 2014

Powered by FUDForum. Page generated in 0.02153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software