org.jaxen
Class SimpleFunctionContext
java.lang.Object
org.jaxen.SimpleFunctionContext
- FunctionContext
public class SimpleFunctionContext
extends java.lang.Object
Simple default implementation of
FunctionContext
.
This is a simple table-based key-lookup implementation
for
FunctionContext
which can be programmatically
extended by registering additional functions.
functions
private HashMap functions
Table of functions.
SimpleFunctionContext
public SimpleFunctionContext()
Construct an empty function context.
registerFunction
public void registerFunction(String namespaceURI,
String localName,
Function function)
Register a new function.
By registering a new function, any XPath expression
that utilizes this
FunctionContext
may
refer to and use the new function.
Functions may exist either in a namespace or not.
Namespace prefix-to-URI resolution is the responsibility
of a
NamespaceContext
. Within this
FunctionContext
functions are only referenced using the URI,
not
the prefix.
The namespace URI of a function may be
null
to indicate that it exists without a namespace.
namespaceURI
- the namespace URI of the function to
be registered with this contextlocalName
- the non-prefixed local portion of the
function to be registered with this contextfunction
- a Function
implementation object
to be used when evaluating the function