Class RootNamespaces

java.lang.Object
com.dassault_systemes.modeler.kerml.model.RootNamespaces

@OpenApiAll public class RootNamespaces extends Object
Utility class to work with root Namespace of the ModelElementProject
  • Constructor Details

    • RootNamespaces

      public RootNamespaces()
  • Method Details

    • getAllRoots

      public static List<Namespace> getAllRoots(ModelElementProject project)
      Returns all root namespaces available in the given project.
      Parameters:
      project - the project whose root namespaces are requested
      Returns:
      list of root namespaces
    • getRoots

      public static List<Namespace> getRoots(com.nomagic.ci.persistence.IProject project)
      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

      public static Stream<Namespace> streamOfAllRoots(ModelElementProject project)
      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

      public static Namespace create(ModelElementProject project)
      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

      @CheckForNull public static Namespace getRootNamespace(Element element)
      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

      public static boolean isRootNamespace(Element element)
      Checks whether the given element is a root namespace.
      Parameters:
      element - the element to check
      Returns:
      true if the element is a root namespace