Package org.jaxen
Class ContextSupport
- java.lang.Object
-
- org.jaxen.ContextSupport
-
- All Implemented Interfaces:
java.io.Serializable
public class ContextSupport extends java.lang.Object implements java.io.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:
XPath for dom4j
,XPath for JDOM
,XPath for W3C DOM
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContextSupport()
Construct an emptyContextSupport
.ContextSupport(NamespaceContext namespaceContext, FunctionContext functionContext, VariableContext variableContext, Navigator navigator)
Create a new ContextSupport object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function
getFunction(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
Retrieve aFunction
.FunctionContext
getFunctionContext()
Retrieve theFunctionContext
.NamespaceContext
getNamespaceContext()
Retrieve theNamespaceContext
.Navigator
getNavigator()
Retrieve theNavigator
.VariableContext
getVariableContext()
Retrieve theVariableContext
.java.lang.Object
getVariableValue(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
Retrieve a variable value.void
setFunctionContext(FunctionContext functionContext)
Set theFunctionContext
.void
setNamespaceContext(NamespaceContext namespaceContext)
Set theNamespaceContext
.void
setVariableContext(VariableContext variableContext)
Set theVariableContext
.java.lang.String
translateNamespacePrefixToUri(java.lang.String prefix)
Translate a namespace prefix to its URI.
-
-
-
Constructor Detail
-
ContextSupport
public ContextSupport()
Construct an emptyContextSupport
.
-
ContextSupport
public ContextSupport(NamespaceContext namespaceContext, FunctionContext functionContext, VariableContext variableContext, Navigator navigator)
Create a new ContextSupport object.- Parameters:
namespaceContext
- the NamespaceContextfunctionContext
- the FunctionContextvariableContext
- the VariableContextnavigator
- the model navigator
-
-
Method Detail
-
setNamespaceContext
public void setNamespaceContext(NamespaceContext namespaceContext)
Set theNamespaceContext
.- Parameters:
namespaceContext
- the namespace context
-
getNamespaceContext
public NamespaceContext getNamespaceContext()
Retrieve theNamespaceContext
.- Returns:
- the namespace context
-
setFunctionContext
public void setFunctionContext(FunctionContext functionContext)
Set theFunctionContext
.- Parameters:
functionContext
- the function context
-
getFunctionContext
public FunctionContext getFunctionContext()
Retrieve theFunctionContext
.- Returns:
- the function context
-
setVariableContext
public void setVariableContext(VariableContext variableContext)
Set theVariableContext
.- Parameters:
variableContext
- the variable context
-
getVariableContext
public VariableContext getVariableContext()
Retrieve theVariableContext
.- Returns:
- the variable context
-
getNavigator
public Navigator getNavigator()
Retrieve theNavigator
.- Returns:
- the navigator
-
translateNamespacePrefixToUri
public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix)
Translate a namespace prefix to its URI.- Parameters:
prefix
- The prefix- Returns:
- the namespace URI mapped to the prefix
-
getVariableValue
public java.lang.Object getVariableValue(java.lang.String namespaceURI, java.lang.String prefix, java.lang.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(java.lang.String namespaceURI, java.lang.String prefix, java.lang.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
-
-