Package com._1c.g5.v8.bm.core
Class BmUriUtil
- java.lang.Object
-
- com._1c.g5.v8.bm.core.BmUriUtil
-
public final class BmUriUtil extends Object
Utility class for manipulating BM object URIs.
-
-
Field Summary
Fields Modifier and Type Field Description static String
BM_SCHEME
The BM URI scheme.static String
TOP_OBJECT_PATH
Top-level object containment path.static String
UNREFERENCEABLE_OBJECT_FRAGMENT
Unreferenceable object fragment.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.eclipse.emf.common.util.URI
createBmResourceUri(String engineId, String fqn)
Creates BM resource URI.static org.eclipse.emf.common.util.URI
createContainedBmObjectUri(String engineId, String fqn, String containmentPath)
Static factory method for creating contained BM object URI.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.static String
createContainedBmObjectUriAsString(String engineId, String fqn, String containmentPath, String context)
Static factory method for creating contained BM object URI as a string.static org.eclipse.emf.common.util.URI
createTopBmObjectUri(String engineId, String fqn)
Static factory method for creating top-level BM object URI.static String
createTopBmObjectUriAsString(String engineId, String fqn)
Static factory method for creating top-level BM object URI as a string.static String
decodeCollectionItemId(String id)
Decodes the specified collection item ID.static String
encodeCollectionItemId(String id)
Encodes the specified collection item ID.static String
extractContainmentPath(String fragment)
Extracts containment path from the specified BM URI fragment.static String
extractContainmentPath(org.eclipse.emf.common.util.URI uri)
Extracts containment path from the specified BM URI.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.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.static String
extractEngineId(org.eclipse.emf.common.util.URI uri)
Extracts engine ID from the specified BM URI.static String
extractTopObjectFqn(org.eclipse.emf.common.util.URI uri)
Extracts top-level object FQN from the specified BM URI.static boolean
isBmUri(org.eclipse.emf.common.util.URI uri)
Checks if the specified URI is a BM URI.static boolean
isTopObjectFragment(String fragment)
Checks if the specified fragment belongs to a top object.static boolean
isTopObjectUri(org.eclipse.emf.common.util.URI uri)
Checks if the specified BM URI belongs to a top object.static boolean
isUnreferenceableObjectFragment(String fragment)
Checks if the specified fragment is an unreferenceable object fragment.
-
-
-
Field Detail
-
BM_SCHEME
public static final String BM_SCHEME
The BM URI scheme.- See Also:
- Constant Field Values
-
TOP_OBJECT_PATH
public static final String TOP_OBJECT_PATH
Top-level object containment path.- See Also:
- Constant Field Values
-
UNREFERENCEABLE_OBJECT_FRAGMENT
public static final String UNREFERENCEABLE_OBJECT_FRAGMENT
Unreferenceable object fragment.- See Also:
- Constant Field Values
-
-
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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.- 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 benull
.fqn
- the corresponding top-level object FQN. May not benull
.- 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 benull
.fqn
- The top-level object FQN. May not benull
.- 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 benull
.fqn
- The top-level object FQN. May not benull
.- 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 benull
.fqn
- The corresponding top-level object FQN. May not benull
.containmentPath
- The containment path. May not benull
.- 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. UsecreateContainedBmObjectUri(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 benull
.fqn
- The corresponding top-level object FQN. May not benull
.containmentPath
- The containment path. May not benull
.context
- The context. May benull
.- 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 benull
.fqn
- The corresponding top-level object FQN. May not benull
.containmentPath
- The containment path. May not benull
.context
- The context. May benull
.- 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 benull
.- Returns:
- if non-
null
ID is provided then its encoded version is returned,null
otherwise.
-
-