Package com.werken.xpath
Class ContextSupport
java.lang.Object
com.werken.xpath.ContextSupport
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.
- Author:
- bob mcwhirter (bob @ werken.com)
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a semantically empty ContextSupportContextSupport
(NamespaceContext nsContext, FunctionContext functionContext, VariableContext variableContext) Construct a semantically initialized ContextSupport -
Method Summary
Modifier and TypeMethodDescriptiongetFunction
(String name) Retrieve a named functiongetVariableValue
(String name) Resolve a variable bindingvoid
setFunctionContext
(FunctionContext functionContext) Set the FunctionContext implementationvoid
setNamespaceContext
(NamespaceContext nsContext) Set the NamespaceContext implementationvoid
setVariableContext
(VariableContext variableContext) Set the VariableContext implementationtranslateNamespacePrefix
(String prefix) Translate a namespace prefix into a URI
-
Constructor Details
-
ContextSupport
public ContextSupport()Construct a semantically empty ContextSupport -
ContextSupport
public ContextSupport(NamespaceContext nsContext, FunctionContext functionContext, VariableContext variableContext) Construct a semantically initialized ContextSupport- Parameters:
nsContext
- The NamespaceContext implementationfunctionContext
- The FunctionContext implementationvariableContext
- The VariableContext implementation
-
-
Method Details
-
setNamespaceContext
Set the NamespaceContext implementation- Parameters:
nsContext
- The NamespaceContext implementation
-
setFunctionContext
Set the FunctionContext implementation- Parameters:
functionContext
- The FunctionContext implementation
-
setVariableContext
Set the VariableContext implementation- Parameters:
variableContext
- The FunctionContext implementation
-
translateNamespacePrefix
Translate a namespace prefix into a URIUsing the
NamespaceContext
implementation, translate the prefix used in a component of an XPath into its expanded namespace URI.- Parameters:
prefix
- The namespace prefix- Returns:
- The URI matching the prefix
- See Also:
-
getFunction
Retrieve a named functionRetrieve the named function object, or null if no such function exists. Delegates to the
FunctionContext
implementation provided, if any.- Parameters:
name
- The name of the function sought.- Returns:
- The
Function
matching the specified name. - See Also:
-
getVariableValue
Resolve a variable bindingRetrieve the currently bound value of the named variable, or null if no such binding exists. Delegates to the
VariableContext
implementation provided, if any.- Parameters:
name
- The name of the variable sought.- Returns:
- The currently bound value of the variable, or null.
- See Also:
-