org.apache.jackrabbit.util.name
Class NamespaceMapping

java.lang.Object
  extended by org.apache.jackrabbit.name.AbstractNamespaceResolver
      extended by org.apache.jackrabbit.util.name.NamespaceMapping
All Implemented Interfaces:
NamespaceResolver

Deprecated. Use the NamespaceMapping class from the org.apache.jackrabbit.spi.commons.namespace package of the jackrabbit-spi-commons component.

public class NamespaceMapping
extends AbstractNamespaceResolver

A Simple Namespace Mapping table. Mappings can be added and then the object can be used as a NamespaceResolver. Additionally, it can be based on a underlying NamespaceResolver


Constructor Summary
NamespaceMapping()
          Deprecated.  
NamespaceMapping(NamespaceResolver base)
          Deprecated. Constructor
 
Method Summary
 boolean equals(Object obj)
          Deprecated. Override equals()
 String getPrefix(String uri)
          Deprecated. Returns the prefix which is mapped to the given URI.
 Map getPrefixToURIMapping()
          Deprecated. Return a Map of prefix to URI mappings currently registered.
 String getURI(String prefix)
          Deprecated. Returns the URI to which the given prefix is mapped.
 Map getURIToPrefixMapping()
          Deprecated. Return a Map of URI to prefix mappings currently registered.
 boolean hasPrefix(String prefix)
          Deprecated. Returns true if prefix is already mapped to some URI.
 void setMapping(String prefix, String uri)
          Deprecated. Set a prefix == URI one-to-one mapping
 String toString()
          Deprecated. Override toString()
 
Methods inherited from class org.apache.jackrabbit.name.AbstractNamespaceResolver
addListener, getJCRName, getQName, notifyNamespaceAdded, notifyNamespaceRemapped, notifyNamespaceRemoved, removeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamespaceMapping

public NamespaceMapping()
Deprecated. 

NamespaceMapping

public NamespaceMapping(NamespaceResolver base)
Deprecated. 
Constructor

Method Detail

getPrefix

public String getPrefix(String uri)
                 throws NamespaceException
Deprecated. 
Returns the prefix which is mapped to the given URI.

Parameters:
uri - namespace URI
Returns:
the prefix mapped to the given URI.
Throws:
NamespaceException - if the URI is unknown.

getURI

public String getURI(String prefix)
              throws NamespaceException
Deprecated. 
Returns the URI to which the given prefix is mapped.

Parameters:
prefix - namespace prefix
Returns:
the namespace URI to which the given prefix is mapped.
Throws:
NamespaceException - if the prefix is unknown.

hasPrefix

public boolean hasPrefix(String prefix)
Deprecated. 
Returns true if prefix is already mapped to some URI. Returns false otherwise.


setMapping

public void setMapping(String prefix,
                       String uri)
                throws NamespaceException
Deprecated. 
Set a prefix == URI one-to-one mapping

Parameters:
prefix -
uri -
Throws:
NamespaceException

getPrefixToURIMapping

public Map getPrefixToURIMapping()
Deprecated. 
Return a Map of prefix to URI mappings currently registered. The returned Map is a copy of the internal Map.

Returns:
Map

getURIToPrefixMapping

public Map getURIToPrefixMapping()
Deprecated. 
Return a Map of URI to prefix mappings currently registered. The returned Map is a copy of the internal Map.

Returns:
Map

equals

public boolean equals(Object obj)
Deprecated. 
Override equals()

Overrides:
equals in class Object
Parameters:
obj -
Returns:
boolean

toString

public String toString()
Deprecated. 
Override toString()

Overrides:
toString in class Object
Returns:
String


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.