Package org.jaxen
Class ContextSupport
java.lang.Object
org.jaxen.ContextSupport
- All Implemented Interfaces:
Serializable
Supporting context information for resolving
namespace prefixes, functions, and variables.
NOTE: This class is not typically used directly, but is exposed for writers of implementation-specific XPath packages.
- Version:
- $Id$
- Author:
- bob mcwhirter
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an emptyContextSupport
.ContextSupport
(NamespaceContext namespaceContext, FunctionContext functionContext, VariableContext variableContext, Navigator navigator) Create a new ContextSupport object. -
Method Summary
Modifier and TypeMethodDescriptiongetFunction
(String namespaceURI, String prefix, String localName) Retrieve aFunction
.Retrieve theFunctionContext
.Retrieve theNamespaceContext
.Retrieve theNavigator
.Retrieve theVariableContext
.getVariableValue
(String namespaceURI, String prefix, String localName) Retrieve a variable value.void
setFunctionContext
(FunctionContext functionContext) Set theFunctionContext
.void
setNamespaceContext
(NamespaceContext namespaceContext) Set theNamespaceContext
.void
setVariableContext
(VariableContext variableContext) Set theVariableContext
.translateNamespacePrefixToUri
(String prefix) Translate a namespace prefix to its URI.
-
Constructor Details
-
ContextSupport
public ContextSupport()Construct an emptyContextSupport
.
-
-
Method Details
-
setNamespaceContext
Set theNamespaceContext
.- Parameters:
namespaceContext
- the namespace context
-
getNamespaceContext
Retrieve theNamespaceContext
.- Returns:
- the namespace context
-
setFunctionContext
Set theFunctionContext
.- Parameters:
functionContext
- the function context
-
getFunctionContext
Retrieve theFunctionContext
.- Returns:
- the function context
-
setVariableContext
Set theVariableContext
.- Parameters:
variableContext
- the variable context
-
getVariableContext
Retrieve theVariableContext
.- Returns:
- the variable context
-
translateNamespacePrefixToUri
Translate a namespace prefix to its URI.- Parameters:
prefix
- The prefix- Returns:
- the namespace URI mapped to the prefix
-
getVariableValue
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException Retrieve a variable value.- Parameters:
namespaceURI
- the function namespace URIprefix
- the function prefixlocalName
- the function name- Returns:
- the variable value.
- Throws:
UnresolvableException
- if unable to locate a bound variable.
-
getFunction
public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException Retrieve aFunction
.- Parameters:
namespaceURI
- the function namespace URIprefix
- the function prefixlocalName
- the function name- Returns:
- the function object
- Throws:
UnresolvableException
- if unable to locate a bound function
-