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$
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FunctionContextFunction context.private NamespaceContextNamespace context.private NavigatorModel navigator.private static final longprivate VariableContextVariable context. -
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.voidsetFunctionContext(FunctionContext functionContext) Set theFunctionContext.voidsetNamespaceContext(NamespaceContext namespaceContext) Set theNamespaceContext.voidsetVariableContext(VariableContext variableContext) Set theVariableContext.translateNamespacePrefixToUri(String prefix) Translate a namespace prefix to its URI.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
functionContext
Function context. -
namespaceContext
Namespace context. -
variableContext
Variable context.
-
-
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
-
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
-