Class AbstractUriMapper
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.translation.AbstractUriMapper
- All Implemented Interfaces:
UriMapper
- Direct Known Subclasses:
DefaultUriMapper
,NamingSystemUriMapper
URI mapper base implementation that recognizes and creates OID URNs
- Since:
- 3.1
- Author:
- Christian Ohr
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionmapNamespaceToUri
(String namespace) Translate a namespace into an URI.mapOidToUri
(String oid) Translate a OID into an URI.mapUriToNamespace
(String uri) Translate a non-URN URI (e.g.mapUriToOid
(String uri) Translate a non-URN URI (e.g.namespaceToUri
(String namespace) Translates an Namespace into an URI.Translates an OID into an URI.uriToNamespace
(String uri) Translates an URI into a Namespace.Translates an URI into an OID.
-
Constructor Details
-
AbstractUriMapper
public AbstractUriMapper()
-
-
Method Details
-
uriToOid
Description copied from interface:UriMapper
Translates an URI into an OID. If the URI is an (OID) URN, the namespace-specific part should, be used as the OID. -
uriToNamespace
Description copied from interface:UriMapper
Translates an URI into a Namespace.- Specified by:
uriToNamespace
in interfaceUriMapper
- Parameters:
uri
- the URI- Returns:
- the mapped namespace
-
oidToUri
Description copied from interface:UriMapper
Translates an OID into an URI. Instead of a real mapping, an URN can be derived from the OID (i.e. urn:oid:1.2.3.4), but in general the inverse mapping toUriMapper.uriToOid(String)
should be applied. -
namespaceToUri
Description copied from interface:UriMapper
Translates an Namespace into an URI. Instead of a real mapping, an URN can be derived from the namespace (i.e. urn:pin:namespace), but in general the inverse mapping toUriMapper.uriToNamespace(String)
(String)} should be applied.- Specified by:
namespaceToUri
in interfaceUriMapper
- Parameters:
namespace
- the namespace- Returns:
- the mapped URI
-
mapUriToOid
Translate a non-URN URI (e.g. a URL) into an OID- Parameters:
uri
- URI- Returns:
- OID string
-
mapUriToNamespace
Translate a non-URN URI (e.g. a URL) into an OID- Parameters:
uri
- URI- Returns:
- OID string
-
mapOidToUri
Translate a OID into an URI. Can either return null or throw an exception if no URL was found.- Parameters:
oid
- OID- Returns:
- valid URI or null if no URI was found
-
mapNamespaceToUri
Translate a namespace into an URI. Can either return null or throw an exception if no URL was found.- Parameters:
namespace
- namespace- Returns:
- valid URI or null if no URI was found
-