All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.nakeduml.metamodel.visitor.NakedElementOwnerVisitor Maven / Gradle / Ivy

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 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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy