org.apache.commons.jxpath.ri

Class NamespaceResolver

Implemented Interfaces:
Cloneable

public class NamespaceResolver
extends java.lang.Object
implements Cloneable

The reference implementation of JXPathContext.
Version:
$Revision: 1.2 $ $Date: 2004/06/29 22:57:20 $
Author:
Dmitri Plotnikov

Field Summary

protected HashMap
namespaceMap
protected NodePointer
pointer
protected HashMap
reverseMap

Method Summary

Object
clone()
Pointer
getNamespaceContextPointer()
String
getNamespaceURI(String prefix)
Given a prefix, returns a registered namespace URI.
String
getPrefix(String namespaceURI)
boolean
isSealed()
void
registerNamespace(String prefix, String namespaceURI)
Registers a namespace prefix.
void
seal()
void
setNamespaceContextPointer(NodePointer pointer)
Register a namespace for the expression context.

Field Details

namespaceMap

protected HashMap namespaceMap

pointer

protected NodePointer pointer

reverseMap

protected HashMap reverseMap

Method Details

clone

public Object clone()

getNamespaceContextPointer

public Pointer getNamespaceContextPointer()

getNamespaceURI

public String getNamespaceURI(String prefix)
Given a prefix, returns a registered namespace URI. If the requested prefix was not defined explicitly using the registerNamespace method, JXPathContext will then check the context node to see if the prefix is defined there. See setNamespaceContextPointer.
Parameters:
prefix - The namespace prefix to look up
Returns:
namespace URI or null if the prefix is undefined.

getPrefix

public String getPrefix(String namespaceURI)

isSealed

public boolean isSealed()

registerNamespace

public void registerNamespace(String prefix,
                              String namespaceURI)
Registers a namespace prefix.
Parameters:
prefix - A namespace prefix
namespaceURI - A URI for that prefix

seal

public void seal()

setNamespaceContextPointer

public void setNamespaceContextPointer(NodePointer pointer)
Register a namespace for the expression context.