APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security.utils

public Class DOMNamespaceContext

extends Object
implements NamespaceContext
Class Inheritance
All Implemented Interfaces
javax.xml.namespace.NamespaceContext
Imports
java.util.Iterator, .Objects, javax.xml.namespace.NamespaceContext, org.w3c.dom.Node

This class adapts the Node namespace/prefix lookup API to that of NamespaceContext. There are some differences:
Function NamespaceContext API Node API
Look up the prefix for a given namespace URI. NamespaceContext#getPrefix(String) Node#lookupPrefix(String)
Look up all the prefixes for a given namespace URI. NamespaceContext#getPrefixes(String) /
Look up the namespace URI for a given prefix. NamespaceContext#getNamespaceURI(String) Node#lookupNamespaceURI(String)
The default prefix. javax.xml.XMLConstants#DEFAULT_NS_PREFIX null
The default namespace URI. javax.xml.XMLConstants#NULL_NS_URI null

Field Summary

Modifier and TypeField and Description
private Node

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getNamespaceURI(String prefix)

Implements javax.xml.namespace.NamespaceContext.getNamespaceURI.

Get Namespace URI bound to a prefix in the current scope.

public String
getPrefix(String namespaceURI)

Implements javax.xml.namespace.NamespaceContext.getPrefix.

Get prefix bound to Namespace URI in the current scope.

public Iterator<String>
public void
setContext(Node context)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
private Node context

Constructor Detail

DOMNamespaceContextback to summary
public DOMNamespaceContext(Node context)

Method Detail

getNamespaceURIback to summary
public String getNamespaceURI(String prefix)

Implements javax.xml.namespace.NamespaceContext.getNamespaceURI.

Doc from javax.xml.namespace.NamespaceContext.getNamespaceURI.

Get Namespace URI bound to a prefix in the current scope.

When requesting a Namespace URI by prefix, the following table describes the returned Namespace URI value for all possible prefix values:

Return value for specified prefixes
prefix parameter Namespace URI return value
DEFAULT_NS_PREFIX ("") default Namespace URI in the current scope or XMLConstants.NULL_NS_URI("") when there is no default Namespace URI in the current scope
bound prefix Namespace URI bound to prefix in current scope
unbound prefix XMLConstants.NULL_NS_URI("")
XMLConstants.XML_NS_PREFIX ("xml") XMLConstants.XML_NS_URI ("http://www.w3.org/XML/1998/namespace")
XMLConstants.XMLNS_ATTRIBUTE ("xmlns") XMLConstants.XMLNS_ATTRIBUTE_NS_URI ("http://www.w3.org/2000/xmlns/")
null IllegalArgumentException is thrown
Annotations
@Override
getPrefixback to summary
public String getPrefix(String namespaceURI)

Implements javax.xml.namespace.NamespaceContext.getPrefix.

Doc from javax.xml.namespace.NamespaceContext.getPrefix.

Get prefix bound to Namespace URI in the current scope.

To get all prefixes bound to a Namespace URI in the current scope, use getPrefixes(String namespaceURI).

When requesting a prefix by Namespace URI, the following table describes the returned prefix value for all Namespace URI values:

Return value for specified Namespace URIs
Namespace URI parameter prefix value returned
<default Namespace URI> XMLConstants.DEFAULT_NS_PREFIX ("")
bound Namespace URI prefix bound to Namespace URI in the current scope, if multiple prefixes are bound to the Namespace URI in the current scope, a single arbitrary prefix, whose choice is implementation dependent, is returned
unbound Namespace URI null
XMLConstants.XML_NS_URI ("http://www.w3.org/XML/1998/namespace") XMLConstants.XML_NS_PREFIX ("xml")
XMLConstants.XMLNS_ATTRIBUTE_NS_URI ("http://www.w3.org/2000/xmlns/") XMLConstants.XMLNS_ATTRIBUTE ("xmlns")
null IllegalArgumentException is thrown
Annotations
@Override
getPrefixesback to summary
public Iterator<String> getPrefixes(String namespaceURI)

Implements javax.xml.namespace.NamespaceContext.getPrefixes.

Throws UnsupportedOperationException.

Annotations
@Override
setContextback to summary
public void setContext(Node context)