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 Modifier and Type Method Description static org.eclipse.emf.common.util.URI
createBmResourceUri(String namespace, String fqn)
Creates BM resource URI.static org.eclipse.emf.common.util.URI
createContainedBmObjectUri(String namespace, String fqn, String containmentPath)
Creates contained BM object URI.static String
createContainedBmObjectUriAsString(String namespace, String fqn, String containmentPath)
Creates contained BM object URI as a string.static org.eclipse.emf.common.util.URI
createTopBmObjectUri(String namespace, String fqn)
Creates top-level BM object URI.static String
createTopBmObjectUriAsString(String namespace, String fqn)
Creates 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(org.eclipse.emf.common.util.URI uri)
Extracts containment path from the specified BM URI.static String
extractNamespace(org.eclipse.emf.common.util.URI uri)
Extracts namespace name 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
-
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 benull
.- 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 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
.
-
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 namespace, String fqn)
Creates BM resource URI.- Parameters:
namespace
- the namespace the resource 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 namespace, String fqn)
Creates top-level BM object URI.- Parameters:
namespace
- The namespace 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 namespace, String fqn)
Creates top-level BM object URI as a string.- Parameters:
namespace
- The namespace 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 namespace, String fqn, String containmentPath)
Creates contained BM object URI.- Parameters:
namespace
- The namespace 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
.
-
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 benull
.fqn
- The corresponding top-level object FQN. May not benull
.containmentPath
- The containment path. May not 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.
-
-