Package com.werken.xpath
Class XPathFunctionContext
java.lang.Object
com.werken.xpath.XPathFunctionContext
- All Implemented Interfaces:
FunctionContext
Implementation of FunctionContext
which
matches the core function library as described by the W3C XPath
Specification.
May be directly instantiated or subclassed. A Singleton is provided for ease-of-use in the default case of bare XPaths.
- Author:
- bob mcwhirter (bob @ werken.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFunction
(String name, Function func) Add a function to this FunctionContextgetFunction
(String name) Retrieve a named functionstatic XPathFunctionContext
Get the XPathFunctionContext singleton.
-
Constructor Details
-
XPathFunctionContext
public XPathFunctionContext()
-
-
Method Details
-
getInstance
Get the XPathFunctionContext singleton.- Returns:
- The global, immutable FunctionContext which matches the functions as described by the W3C XPath specification.
-
addFunction
Add a function to this FunctionContext- Parameters:
name
- The name of the function.func
- The implementing Function Object.
-
getFunction
Retrieve a named functionRetrieve the named function object, or null if no such function exists.
- Specified by:
getFunction
in interfaceFunctionContext
- Parameters:
name
- The name of the function sought.- Returns:
- The
Function
matching the specified name. - See Also:
-