org.springframework.util.xml
Class SimpleNamespaceContext

java.lang.Object
  extended by org.springframework.util.xml.SimpleNamespaceContext
All Implemented Interfaces:
NamespaceContext

public class SimpleNamespaceContext
extends Object
implements NamespaceContext

Simple javax.xml.namespace.NamespaceContext implementation. Follows the standard NamespaceContext contract, and is loadable via a java.util.Map or java.util.Properties object

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
SimpleNamespaceContext()
           
 
Method Summary
 void bindDefaultNamespaceUri(String namespaceUri)
          Binds the given namespace as default namespace.
 void bindNamespaceUri(String prefix, String namespaceUri)
          Binds the given prefix to the given namespace.
 void clear()
          Removes all declared prefixes.
 Iterator getBoundPrefixes()
          Returns all declared prefixes.
 String getNamespaceURI(String prefix)
           
 String getPrefix(String namespaceUri)
           
 Iterator getPrefixes(String namespaceUri)
           
 void removeBinding(String prefix)
          Removes the given prefix from this context.
 void setBindings(Map<String,String> bindings)
          Sets the bindings for this namespace context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleNamespaceContext

public SimpleNamespaceContext()
Method Detail

getNamespaceURI

public String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface NamespaceContext

getPrefix

public String getPrefix(String namespaceUri)
Specified by:
getPrefix in interface NamespaceContext

getPrefixes

public Iterator getPrefixes(String namespaceUri)
Specified by:
getPrefixes in interface NamespaceContext

setBindings

public void setBindings(Map<String,String> bindings)
Sets the bindings for this namespace context. The supplied map must consist of string key value pairs.

Parameters:
bindings - the bindings

bindDefaultNamespaceUri

public void bindDefaultNamespaceUri(String namespaceUri)
Binds the given namespace as default namespace.

Parameters:
namespaceUri - the namespace uri

bindNamespaceUri

public void bindNamespaceUri(String prefix,
                             String namespaceUri)
Binds the given prefix to the given namespace.

Parameters:
prefix - the namespace prefix
namespaceUri - the namespace uri

clear

public void clear()
Removes all declared prefixes.


getBoundPrefixes

public Iterator getBoundPrefixes()
Returns all declared prefixes.

Returns:
the declared prefixes

removeBinding

public void removeBinding(String prefix)
Removes the given prefix from this context.

Parameters:
prefix - the prefix to be removed