|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectglobal.sandbox.xmlutilities.NamespaceContextImpl
public class NamespaceContextImpl
Simple implementation of the NamespaceContext.
Field Summary | |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
namespaces
stores namespace mappings |
Constructor Summary | |
---|---|
NamespaceContextImpl()
Creates a new instance of NamespaceContextImpl and adds default namespace URIs |
Method Summary | |
---|---|
void |
addDefaultNamespaces()
adds default namespace URIs Default namespace URIs are DEFAULT_NS_PREFIX, XML_NS_PREFIX and XMLNS_ATTRIBUTE. |
void |
addNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
adds namespace URI specified with prefix and URI |
void |
addNamespaces(java.util.Map<java.lang.String,java.lang.String> namespaceURIs)
adds all the namespace URIs that are stored in the specified Map |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
returnes namespace URI that corresponds to the specified prefix |
java.lang.String |
getPrefix(java.lang.String namespaceURI)
returnes the prefix for the corresponding namespace URI this method returnes the first occurrence of the prefix for given URI |
java.util.Iterator |
getPrefixes(java.lang.String namespaceURI)
returnes iterator for the set of all the prefixes that correspond to the specified URI |
void |
removeAllNamespaces()
removes all the namespace URIs incl. default ones |
void |
removeNamespaceByPrefix(java.lang.String prefix)
removes specified namespace using prefix |
void |
removeNamespaceByURI(java.lang.String uri)
removes specified namespace using URI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.Map<java.lang.String,java.lang.String> namespaces
Constructor Detail |
---|
public NamespaceContextImpl()
Method Detail |
---|
public void addNamespace(java.lang.String prefix, java.lang.String namespaceURI)
prefix
- prefix of the namespacenamespaceURI
- URI of the namespacepublic void addNamespaces(java.util.Map<java.lang.String,java.lang.String> namespaceURIs)
namespaceURIs
- URIs to add, key is prefix, value is URIpublic void addDefaultNamespaces()
public void removeNamespaceByPrefix(java.lang.String prefix)
prefix
- of the namespacepublic void removeNamespaceByURI(java.lang.String uri)
uri
- URI of the namespace to removepublic void removeAllNamespaces()
public java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI
in interface javax.xml.namespace.NamespaceContext
prefix
- URI of the namespace to obtain
public java.lang.String getPrefix(java.lang.String namespaceURI)
getPrefix
in interface javax.xml.namespace.NamespaceContext
namespaceURI
- namespace URI
public java.util.Iterator getPrefixes(java.lang.String namespaceURI)
getPrefixes
in interface javax.xml.namespace.NamespaceContext
namespaceURI
- namespace URI
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |