tree: a83c120770e8503e6327161cdf48b7ccaf6a1d7c [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
commons/namespaceprefix/service/README.md

Namespace Prefix Service

The Namespace Prefix Service allows to provide and manage namespace prefix mappings. Prefixes are unique however multiple prefixes might be used for the same namespace.

Architecture

This module defines two services:

  1. NamespacePrefixService - user level service used to lookup namespace prefixes. It also allows to set prefix mappings
  2. NamespacePrefixProvider - internally used to provide prefix to namespace mappings

NamespacePrefixService

User level service used to lookup namespace prefixes. It also allows to set prefix mappings

:::java
NamespacePrefixService

    /** bidi mapping prefix - namespace */
    getNamespace(String prefix) : String
    getPrefix(String namespace) : String
    /** A namespace may be mapped to multiple prefixes */
    getPrefixes(String namespace) : List<String>
    /** adds an new Prefix and returns the old mapping */
    setPrefix(String prefix, String namespace) : String

    /** converts prefix:localName to full URIs */
    getFullName(String shortName) : String

    /** converts URIs to prefix:localName */
    getShortName(String uri) : String

NamespacePrefixProvider

Service that provides namespace prefix mappings. Multiple of such services can be registered and will be used by the NamespacePrefixService. If a provider can not provide a mapping for a prefix/namespace, than it is expected to return null. The NamespacePrefixService will call provider in the order of their service.ranking when looking for mappings.

:::java
NamespacePrefixProvider

    getNamespace(String prefix) : String
    getPrefix(String namespace) : String
    /** A namespace may be mapped to multiple prefixes */
    getPrefixes(String namespace) : List<String>