com.werken.xpath
Class XPathFunctionContext

java.lang.Object
  extended by com.werken.xpath.XPathFunctionContext
All Implemented Interfaces:
FunctionContext

public class XPathFunctionContext
extends java.lang.Object
implements 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
XPathFunctionContext()
           
 
Method Summary
protected  void addFunction(java.lang.String name, Function func)
          Add a function to this FunctionContext
 Function getFunction(java.lang.String name)
          Retrieve a named function
static XPathFunctionContext getInstance()
          Get the XPathFunctionContext singleton.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPathFunctionContext

public XPathFunctionContext()
Method Detail

getInstance

public static XPathFunctionContext getInstance()
Get the XPathFunctionContext singleton.

Returns:
The global, immutable FunctionContext which matches the functions as described by the W3C XPath specification.

addFunction

protected void addFunction(java.lang.String name,
                           Function func)
Add a function to this FunctionContext

Parameters:
name - The name of the function.
func - The implementing Function Object.

getFunction

public Function getFunction(java.lang.String name)
Retrieve a named function

Retrieve the named function object, or null if no such function exists.

Specified by:
getFunction in interface FunctionContext
Parameters:
name - The name of the function sought.
Returns:
The Function matching the specified name.
See Also:
com.werken.xpath.ContextHelper#setFunctionContext


Copyright ? 2000 bob mcwhirter and The Werken & Sons Company. All Rights Reserved.