Skip to main content



      Home
Home » Archived » 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 10:14 Go to next message
Eclipse UserFriend
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 12:39 Go to previous messageGo to next message
Eclipse UserFriend
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 16:58 Go to previous messageGo to next message
Eclipse UserFriend
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 09:53 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 01:35:10 EDT 2025

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

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

Back to the top