How to get relevant data from a Stereotype [message #654909] |
Thu, 17 February 2011 15:14 |
|
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 #654992 is a reply to message #654946] |
Thu, 17 February 2011 21:58 |
|
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 ?
|
|
|
|
Powered by
FUDForum. Page generated in 0.04066 seconds