Class BmUriUtil


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

      • extractEngineId

        public static String extractEngineId​(org.eclipse.emf.common.util.URI uri)
        Extracts engine ID from the specified BM URI.
        Parameters:
        uri - The URI. May not be null.
        Returns:
        the engine ID this URI belongs to, 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.
      • extractContainmentPath

        public static String extractContainmentPath​(String fragment)
        Extracts containment path from the specified BM URI fragment.
        Parameters:
        fragment - The BM URI fragment. May not be null.
        Returns:
        the extracted path or null.
      • extractContext

        @Deprecated
        public static String extractContext​(org.eclipse.emf.common.util.URI uri)
        Deprecated.
        Contexts have been introduced to solve the problem with converting derived field URIs to symbolic names and are not intended to be widely used.
        Extracts context information from the specified BM URI.
        Parameters:
        uri - The BM URI. May not be null.
        Returns:
        the extracted context information or null.
      • extractContext

        @Deprecated
        public static String extractContext​(String fragment)
        Deprecated.
        Contexts have been introduced to solve the problem with converting derived field URIs to symbolic names and are not intended to be widely used.
        Extracts context information from the specified BM URI fragment.
        Parameters:
        fragment - The BM URI fragment. May not be null.
        Returns:
        the extracted context information 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 engineId,
                                                                          String fqn)
        Creates BM resource URI.
        Parameters:
        engineId - the ID of the engine the URI 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 engineId,
                                                                           String fqn)
        Static factory method for creating top-level BM object URI.
        Parameters:
        engineId - The ID of the engine 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 engineId,
                                                          String fqn)
        Static factory method for creating top-level BM object URI as a string.
        Parameters:
        engineId - The ID of the engine 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 engineId,
                                                                                 String fqn,
                                                                                 String containmentPath)
        Static factory method for creating contained BM object URI.
        Parameters:
        engineId - The ID of the engine 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.
      • createContainedBmObjectUri

        @Deprecated
        public static org.eclipse.emf.common.util.URI createContainedBmObjectUri​(String engineId,
                                                                                 String fqn,
                                                                                 String containmentPath,
                                                                                 String context)
        Deprecated.
        Contexts have been introduced to solve the problem with converting derived field URIs to symbolic names and are not intended to be widely used. Use createContainedBmObjectUri(String, String, String) instead.
        Static factory method for creating contained BM object URI.
        Parameters:
        engineId - The ID of the engine 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.
        context - The context. May be null.
        Returns:
        the created URI, not null.
      • createContainedBmObjectUriAsString

        public static String createContainedBmObjectUriAsString​(String engineId,
                                                                String fqn,
                                                                String containmentPath,
                                                                String context)
        Static factory method for creating contained BM object URI as a string.
        Parameters:
        engineId - The ID of the engine 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.
        context - The context. May 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.