com.werken.xpath
Class ContextSupport
java.lang.Object
com.werken.xpath.ContextSupport
public class ContextSupport
extends java.lang.Object
ContextSupport maintains information to aid in the
execution of the XPath against a context node.
It separates the knowledge of functions, variables
and namespace-bindings from the context node to
be walked.
- bob mcwhirter (bob @ werken.com)
ContextSupport
public ContextSupport()
Construct a semantically empty ContextSupport
ContextSupport
public ContextSupport(NamespaceContext nsContext,
FunctionContext functionContext,
VariableContext variableContext)
Construct a semantically initialized ContextSupport
nsContext
- The NamespaceContext implementationfunctionContext
- The FunctionContext implementationvariableContext
- The VariableContext implementation
getFunction
public Function getFunction(String name)
Retrieve a named function
Retrieve the named function object, or null
if no such function exists. Delegates to the
FunctionContext
implementation
provided, if any.
name
- The name of the function sought.
- The
Function
matching the specified name.
setFunctionContext(FunctionContext)
getVariableValue
public Object getVariableValue(String name)
Resolve a variable binding
Retrieve the currently bound value of the named
variable, or null if no such binding exists. Delegates
to the
VariableContext
implementation
provided, if any.
name
- The name of the variable sought.
- The currently bound value of the variable, or null.
setVariableContext(VariableContext)
setFunctionContext
public void setFunctionContext(FunctionContext functionContext)
Set the FunctionContext implementation
functionContext
- The FunctionContext implementation
setNamespaceContext
public void setNamespaceContext(NamespaceContext nsContext)
Set the NamespaceContext implementation
nsContext
- The NamespaceContext implementation
setVariableContext
public void setVariableContext(VariableContext variableContext)
Set the VariableContext implementation
variableContext
- The FunctionContext implementation
translateNamespacePrefix
public String translateNamespacePrefix(String prefix)
Translate a namespace prefix into a URI
Using the
NamespaceContext
implementation, translate the prefix used in a component of an XPath
into its expanded namespace URI.
prefix
- The namespace prefix
- The URI matching the prefix
setNamespaceContext(NamespaceContext)
Copyright B) 2000 bob mcwhirter and The Werken & Sons Company. All Rights Reserved.