Package org.somda.sdc.glue.common.uri
Class ContextIdentificationMapper
java.lang.Object
org.somda.sdc.glue.common.uri.ContextIdentificationMapper
Utility class to map between context-based URIs and instance identifiers.
This class implements the grammar defined in IEEE 11073-20701 section 9.4.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the context instance identifier URI type. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfromInstanceIdentifier(InstanceIdentifier instanceIdentifier, ContextIdentificationMapper.ContextSource contextSource) Converts from an instance identifier to an URI.static InstanceIdentifierfromUri(String contextIdentificationUri, ContextIdentificationMapper.ContextSource expectedContextSource) Converts from an URI string to an instance identifier.
-
Constructor Details
-
ContextIdentificationMapper
public ContextIdentificationMapper()
-
-
Method Details
-
fromInstanceIdentifier
public static String fromInstanceIdentifier(InstanceIdentifier instanceIdentifier, ContextIdentificationMapper.ContextSource contextSource) throws UriMapperGenerationArgumentException Converts from an instance identifier to an URI.- Parameters:
instanceIdentifier- the instance identifier to convert.contextSource- the type of context to create a scheme for.- Returns:
- an URI that reflects the instance identifier.
- Throws:
UriMapperGenerationArgumentException- in case no valid URI could be generated from the input.
-
fromUri
public static InstanceIdentifier fromUri(String contextIdentificationUri, ContextIdentificationMapper.ContextSource expectedContextSource) throws UriMapperParsingException Converts from an URI string to an instance identifier.- Parameters:
contextIdentificationUri- the URI to parse.expectedContextSource- the expected context source.- Returns:
- the converted instance identifier.
- Throws:
UriMapperParsingException- in case no valid URI was given.
-