Class RootNamespaces
java.lang.Object
com.dassault_systemes.modeler.kerml.model.RootNamespaces
Utility class to work with root
Namespace of the ModelElementProject-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Namespacecreate(ModelElementProject project) Creates a new root namespace in the given project.getAllRoots(ModelElementProject project) Returns all root namespaces available in the given project.static NamespacegetRootNamespace(Element element) Returns the root namespace that contains the given element.getRoots(com.nomagic.ci.persistence.IProject project) Returns the root namespaces stored in the KerML project feature of the given project.static booleanisRootNamespace(Element element) Checks whether the given element is a root namespace.streamOfAllRoots(ModelElementProject project) Returns a stream of all root namespaces across the primary project and all its related projects.
-
Constructor Details
-
RootNamespaces
public RootNamespaces()
-
-
Method Details
-
getAllRoots
Returns all root namespaces available in the given project.- Parameters:
project- the project whose root namespaces are requested- Returns:
- list of root namespaces
-
getRoots
Returns the root namespaces stored in the KerML project feature of the given project.- Parameters:
project- the project to inspect- Returns:
- list of root namespaces, or an empty list if none exist
-
streamOfAllRoots
Returns a stream of all root namespaces across the primary project and all its related projects.- Parameters:
project- the project whose root namespaces are requested- Returns:
- stream of root namespaces
-
create
Creates a new root namespace in the given project.- Parameters:
project- the project where the root namespace will be created- Returns:
- the newly created root namespace
- Throws:
IllegalArgumentException- if the project does not support KerML features
-
getRootNamespace
Returns the root namespace that contains the given element.- Parameters:
element- the element whose root namespace is requested- Returns:
- the root namespace, or null if none is found
-
isRootNamespace
Checks whether the given element is a root namespace.- Parameters:
element- the element to check- Returns:
- true if the element is a root namespace
-