net.sf.nakeduml.metamodel.visitor.NakedElementOwnerVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metamodel Show documentation
Show all versions of metamodel Show documentation
A uml code generator and execution engine
The newest version!
package net.sf.nakeduml.metamodel.visitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.sf.nakeduml.feature.visit.VisitorAdapter;
import net.sf.nakeduml.metamodel.core.INakedClassifier;
import net.sf.nakeduml.metamodel.core.INakedElementOwner;
import net.sf.nakeduml.metamodel.core.INakedNameSpace;
import net.sf.nakeduml.metamodel.workspace.INakedModelWorkspace;
import nl.klasse.octopus.expressions.internal.types.PathName;
public class NakedElementOwnerVisitor extends VisitorAdapter {
@Override
public Collection extends INakedElementOwner> getChildren(INakedElementOwner root) {
return root.getOwnedElements();
}
//TODO find a better place for this method
protected PathName getPathNameInModel(INakedClassifier stereotype){
List names = new ArrayList();
names.add(stereotype.getName());
INakedNameSpace p = stereotype.getNameSpace();
while(p != null){
names.add(0, p.getName());
p = p.getNameSpace();
}
PathName pn = new PathName();
for(String s:names){
pn.addString(s);
}
return pn;
}
}