|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jaxen.SimpleFunctionContext
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.
XPathFunctionContext
Constructor Summary | |
SimpleFunctionContext()
Construct. |
Method Summary | |
Function |
getFunction(String namespaceURI,
String prefix,
String localName)
An implementation should return a Function implementation object
based on the namespace uri and local name of the function-call
expression. |
void |
registerFunction(String namespaceURI,
String localName,
Function function)
Register a new function. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleFunctionContext()
Construct with an empty function lookup table.
Method Detail |
public void registerFunction(String namespaceURI, String localName, Function 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 an 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 context.localName
- The non-prefixed local portion of the
function to be registered with this context.function
- A Function
implementation object
to be used when evaluating the function.public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException
FunctionContext
Function
implementation object
based on the namespace uri and local name of the function-call
expression.
It must not use the prefix parameter to select an implementation, because a prefix could be bound to any namespace; the prefix parameter could be used in debugging output or other generated information. The prefix may otherwise be completely ignored.
getFunction
in interface FunctionContext
org.jaxen.FunctionContext
namespaceURI
- the namespace uri to which the prefix parameter
is bound in the xpath expression. If the function
call expression had no prefix, the namespace uri
is null
.prefix
- the prefix that was used in the function call
expression.localName
- the local name of the function-call expression;
if there is no prefix, then this is the whole
name of the function.UnresolvableException
- when the function cannot be resolved.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |