Class BmUriUtil


  • public final class BmUriUtil
    extends Object
    Utility class for manipulating BM object URIs.
    • Method Detail

      • extractNamespace

        public static String extractNamespace​(org.eclipse.emf.common.util.URI uri)
        Extracts namespace name from the specified BM URI.
        Parameters:
        uri - The URI. May not be null.
        Returns:
        the extracted name, not null.
      • extractTopObjectFqn

        public static String extractTopObjectFqn​(org.eclipse.emf.common.util.URI uri)
        Extracts top-level object FQN from the specified BM URI.
        Parameters:
        uri - The URI. May not be null.
        Returns:
        the extracted FQN, not null.
      • extractContainmentPath

        public static String extractContainmentPath​(org.eclipse.emf.common.util.URI uri)
        Extracts containment path from the specified BM URI.
        Parameters:
        uri - The BM URI. May not be null.
        Returns:
        the extracted containment path or null.
      • isBmUri

        public static boolean isBmUri​(org.eclipse.emf.common.util.URI uri)
        Checks if the specified URI is a BM URI.
        Parameters:
        uri - The URI to check. May not be null.
        Returns:
        true if the URI is a BM URI, false otherwise.
      • isTopObjectFragment

        public static boolean isTopObjectFragment​(String fragment)
        Checks if the specified fragment belongs to a top object.
        Parameters:
        fragment - The fragment to check. May not be null.
        Returns:
        true if the specified fragment belongs to a top object, false otherwise.
      • isTopObjectUri

        public static boolean isTopObjectUri​(org.eclipse.emf.common.util.URI uri)
        Checks if the specified BM URI belongs to a top object.
        Parameters:
        uri - The BM URI to check. May not be null.
        Returns:
        true if the specified URI belongs to a top object, false otherwise.
      • isUnreferenceableObjectFragment

        public static boolean isUnreferenceableObjectFragment​(String fragment)
        Checks if the specified fragment is an unreferenceable object fragment.
        Parameters:
        fragment - The fragment to check. May not be null.
        Returns:
        true if the specified fragment is an unreferenceable object fragment, false otherwise.
      • createBmResourceUri

        public static org.eclipse.emf.common.util.URI createBmResourceUri​(String namespace,
                                                                          String fqn)
        Creates BM resource URI.
        Parameters:
        namespace - the namespace the resource belongs to, may not be null.
        fqn - the corresponding top-level object FQN. May not be null.
        Returns:
        the created URI, not null.
      • createTopBmObjectUri

        public static org.eclipse.emf.common.util.URI createTopBmObjectUri​(String namespace,
                                                                           String fqn)
        Creates top-level BM object URI.
        Parameters:
        namespace - The namespace the object belongs to. May not be null.
        fqn - The top-level object FQN. May not be null.
        Returns:
        the created URI, not null.
      • createTopBmObjectUriAsString

        public static String createTopBmObjectUriAsString​(String namespace,
                                                          String fqn)
        Creates top-level BM object URI as a string.
        Parameters:
        namespace - The namespace the object belongs to. May not be null.
        fqn - The top-level object FQN. May not be null.
        Returns:
        the created URI, not null.
      • createContainedBmObjectUri

        public static org.eclipse.emf.common.util.URI createContainedBmObjectUri​(String namespace,
                                                                                 String fqn,
                                                                                 String containmentPath)
        Creates contained BM object URI.
        Parameters:
        namespace - The namespace the object belongs to. May be null.
        fqn - The corresponding top-level object FQN. May not be null.
        containmentPath - The containment path. May not be null.
        Returns:
        the created URI, not null.
      • createContainedBmObjectUriAsString

        public static String createContainedBmObjectUriAsString​(String namespace,
                                                                String fqn,
                                                                String containmentPath)
        Creates contained BM object URI as a string.
        Parameters:
        namespace - The namespace the object belongs to. May be null.
        fqn - The corresponding top-level object FQN. May not be null.
        containmentPath - The containment path. May not be null.
        Returns:
        the created URI, not null.
      • encodeCollectionItemId

        public static String encodeCollectionItemId​(String id)
        Encodes the specified collection item ID.
        Parameters:
        id - The ID to encode, may be null.
        Returns:
        if non-null ID is provided then its encoded version is returned, null otherwise.
      • decodeCollectionItemId

        public static String decodeCollectionItemId​(String id)
        Decodes the specified collection item ID.
        Parameters:
        id - The ID to decode, may be null.
        Returns:
        if non-null ID is provided then its decoded version is returned, null otherwise.