Class XMPSchemaRegistryImpl

  • All Implemented Interfaces:
    XMPConst, XMPSchemaRegistry

    public final class XMPSchemaRegistryImpl
    extends Object
    implements XMPSchemaRegistry, XMPConst
    The schema registry handles the namespaces, aliases and global options for the XMP Toolkit. There is only one single instance used by the toolkit.
    Since:
    27.01.2006
    • Constructor Detail

      • XMPSchemaRegistryImpl

        public XMPSchemaRegistryImpl()
        Performs the initialisation of the registry with the default namespaces, aliases and global options.
    • Method Detail

      • registerNamespace

        public String registerNamespace​(String namespaceURI,
                                        String suggestedPrefix)
                                 throws XMPException
        Description copied from interface: XMPSchemaRegistry
        Register a namespace URI with a suggested prefix. It is not an error if the URI is already registered, no matter what the prefix is. If the URI is not registered but the suggested prefix is in use, a unique prefix is created from the suggested one. The actual registeed prefix is always returned. The function result tells if the registered prefix is the suggested one.

        Note: No checking is presently done on either the URI or the prefix.

        Specified by:
        registerNamespace in interface XMPSchemaRegistry
        Parameters:
        namespaceURI - The URI for the namespace. Must be a valid XML URI.
        suggestedPrefix - The suggested prefix to be used if the URI is not yet registered. Must be a valid XML name.
        Returns:
        Returns the registered prefix for this URI, is equal to the suggestedPrefix if the namespace hasn't been registered before, otherwise the existing prefix.
        Throws:
        XMPException - If the parameters are not accordingly set
        See Also:
        XMPSchemaRegistry.registerNamespace(String, String)
      • getNamespaceURI

        public String getNamespaceURI​(String namespacePrefix)
        Description copied from interface: XMPSchemaRegistry
        Obtain the URI for a registered namespace prefix.

        It is not an error if the namespace prefix is not registered.

        Specified by:
        getNamespaceURI in interface XMPSchemaRegistry
        Parameters:
        namespacePrefix - The prefix for the namespace. Must not be null or the empty string.
        Returns:
        Returns the URI registered for this prefix or null.
        See Also:
        XMPSchemaRegistry.getNamespaceURI(String)
      • resolveAlias

        public XMPAliasInfo resolveAlias​(String aliasNS,
                                         String aliasProp)
        Description copied from interface: XMPSchemaRegistry
        Determines if a name is an alias, and what it is aliased to.
        Specified by:
        resolveAlias in interface XMPSchemaRegistry
        Parameters:
        aliasNS - The namespace URI of the alias. Must not be null or the empty string.
        aliasProp - The name of the alias. May be an arbitrary path expression path, must not be null or the empty string.
        Returns:
        Returns the XMPAliasInfo for the given alias namespace and property or null if there is no such alias.
        See Also:
        XMPSchemaRegistry.resolveAlias(String, String)