Item is the base interface of Node * and Property. * * @author Markus Nix * @package phpcr */ interface NamespaceRegistry { /** * Sets a one-to-one mapping between prefix and URI in the global namespace registry of this repository. * Assigning a new prefix to a URI that already exists in the namespace registry erases the old prefix. * In general this can almost always be done, though an implementation is free to prevent particular * remappings by throwing a NamespaceException. *

* On the other hand, taking a prefix that is already assigned to a URI and re-assigning it to a new URI * in effect unregisters that URI. Therefore, the same restrictions apply to this operation as to * NamespaceRegistry.unregisterNamespace: *

* In a level 1 implementation, this method always throws an * UnsupportedRepositoryOperationException. *

* A RepositoryException is thrown if another error occurs. * * @param prefix The prefix to be mapped. * @param uri The URI to be mapped. * @throws NamespaceException if an illegal attempt is made to register a mapping. * @throws UnsupportedRepositoryOperationException in a level 1 implementation * @throws RepositoryException if another error occurs. */ public function registerNamespace( $prefix, $uri ); /** * Removes a namespace mapping from the registry. The following restriction apply: *

* In a level 1 implementation, this method always throws an * UnsupportedRepositoryOperationException. *

* A RepositoryException is thrown if another error occurs. * * @param prefix The prefix of the mapping to be removed. * @throws NamespaceException if an illegal attempt is made to remove a mapping. * @throws UnsupportedRepositoryOperationException in a level 1 implementation * @throws RepositoryException if another error occurs. */ public function unregisterNamespace( $prefix ); /** * Returns an array holding all currently registered prefixes. * @return a string array * @throws RepositoryException if an error occurs. */ public function getPrefixes(); /** * Returns an array holding all currently registered URIs. * @return a string array * @throws RepositoryException if an error occurs. */ public function getURIs(); /** * Returns the URI to which the given prefix is mapped. * @param prefix a string * @return a string * @throws NamespaceException if the prefix is unknown. * @throws RepositoryException is another error occurs */ public function getURI( $prefix ); /** * Returns the prefix to which the given URI is mapped * * @param uri a string * @return a string * @throws NamespaceException if the URI is unknown. * @throws RepositoryException is another error occurs */ public function getPrefix( $uri ); } ?>