Package org.somda.sdc.glue.common.uri
Class ContextIdentificationMapper
- java.lang.Object
-
- org.somda.sdc.glue.common.uri.ContextIdentificationMapper
-
public class ContextIdentificationMapper extends Object
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 Classes Modifier and Type Class Description static classContextIdentificationMapper.ContextSourceDefines the context instance identifier URI type.
-
Constructor Summary
Constructors Constructor Description ContextIdentificationMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
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.
-
-