|
|||||||||
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 Map<String,String> |
namespaces
Stores name space mappings. |
Constructor Summary | |
---|---|
|
NamespaceContextImpl()
Creates a new instance of NamespaceContextImpl and adds default name space URIs. |
private |
NamespaceContextImpl(Void v)
Internal constructor for empty context without defaults. |
Method Summary | |
---|---|
void |
addDefaultNamespaces()
Adds default name space URIs. |
private void |
addDefaultNamespaces0()
Adds default name space URIs. |
void |
addNamespace(String prefix,
String namespaceURI)
Adds name space URI specified with prefix and URI. |
void |
addNamespaces(Map<String,String> namespaceURIs)
Adds all the name space URIs that are stored in the specified Map. |
static NamespaceContextImpl |
emptyNamespaceContext()
Factory method which creates empty name space context without defaults. |
String |
getNamespaceURI(String prefix)
Returns name space URI that corresponds to the specified prefix. |
String |
getPrefix(String namespaceURI)
Returns the prefix for the corresponding name space URI. |
Iterator<String> |
getPrefixes(String namespaceURI)
Returns iterator for the set of all the prefixes that correspond to the specified URI. |
static NamespaceContextImpl |
namespaceContextWithDefaults()
Factory method which creates empty name space context with defaults. |
void |
removeAllNamespaces()
Removes all the name space URIs including default ones. |
void |
removeNamespaceByPrefix(String prefix)
Removes specified name space specified by prefix. |
void |
removeNamespaceByURI(String uri)
Removes specified name space specified by URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<String,String> namespaces
Constructor Detail |
---|
public NamespaceContextImpl()
private NamespaceContextImpl(Void v)
v
- null
Method Detail |
---|
public static NamespaceContextImpl emptyNamespaceContext()
public static NamespaceContextImpl namespaceContextWithDefaults()
public void addNamespace(String prefix, String namespaceURI)
prefix
- prefix of the name spacenamespaceURI
- URI of the name spacepublic void addNamespaces(Map<String,String> namespaceURIs)
namespaceURIs
- URIs to add, key is prefix, value is URIpublic void addDefaultNamespaces()
DEFAULT_NS_PREFIX
, XML_NS_PREFIX
and XMLNS_ATTRIBUTE
.
private void addDefaultNamespaces0()
DEFAULT_NS_PREFIX
, XML_NS_PREFIX
and XMLNS_ATTRIBUTE
.
public void removeNamespaceByPrefix(String prefix)
prefix
- of the name spacepublic void removeNamespaceByURI(String uri)
uri
- URI of the name space to removepublic void removeAllNamespaces()
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
prefix
- URI of the name space to obtain
NULL_NS_URI
if not foundpublic String getPrefix(String namespaceURI)
getPrefix
in interface NamespaceContext
namespaceURI
- name space URI
null
if not foundpublic Iterator<String> getPrefixes(String namespaceURI)
getPrefixes
in interface NamespaceContext
namespaceURI
- name space URI
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |