Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET] Unable to retrieve stereotype list of a UML element in an XPath function([JET] Unable to retrieve stereotype list of a UML element in an XPath function)
icon5.gif  [JET] Unable to retrieve stereotype list of a UML element in an XPath function [message #759083] Sat, 26 November 2011 07:05
Pavan V is currently offline Pavan V
Messages: 2
Registered: July 2009
Junior Member
Hello there,

I've written a JET template that needs to iterate over certain UML elements (with specific stereotypes). For the stereotype check, I've added an XPath function with the body -

public Object evaluate(List args) {
NodeSet nodeSet = (NodeSet)args.get(0);
Namespace source = (Namespace)nodeSet.iterator().next();
String stereotypeName = (String)args.get(1);

List<Action> actions = new ArrayList<Action>();

Iterator<NamedElement> iter = source.getOwnedMembers().iterator();
while(iter.hasNext()){
NamedElement child = iter.next();
if(child instanceof Action && (namedEle.getAppliedStereotype(stereotypeName) != null)){
actions.add((Action) child);
}
}
return actions;
}

Although I see that my input model has the profiles and the stereotypes in place, the call namedEle.getAppliedStereotypes() always returns an empty list

Any pointers on what I may be doing wrong here ?
Previous Topic:[acceleo 3.2.X & Java & Maven] Tutorial for developpers [solved]
Next Topic:[xtend] typeSelect()
Goto Forum:
  


Current Time: Wed Oct 22 09:47:55 GMT 2014

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

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