org.jaxen
Class ContextSupport

java.lang.Object
  extended byorg.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 prefixess, functions, and variables.

NOTE: This class is not typically used directly, but is exposed for writers of implementation-specific XPath packages.

Version:
$Id: ContextSupport.java,v 1.8 2003/06/09 03:22:24 bob Exp $
Author:
bob mcwhirter
See Also:
XPath for dom4j, XPath for JDOM, XPath for W3C DOM, Serialized Form

Field Summary
private  FunctionContext functionContext
          Function context.
private  NamespaceContext namespaceContext
          Namespace context.
private  Navigator navigator
          Model navigator.
private  VariableContext variableContext
          Variable context.
 
Constructor Summary
ContextSupport()
          Construct an empty ContextSupport.
ContextSupport(NamespaceContext namespaceContext, FunctionContext functionContext, VariableContext variableContext, Navigator navigator)
          Construct.
 
Method Summary
 Function getFunction(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
          Retrieve a Function.
 FunctionContext getFunctionContext()
          Retrieve the FunctionContext.
 NamespaceContext getNamespaceContext()
          Retrieve the NamespaceContext.
 Navigator getNavigator()
          Retrieve the Navigator.
 VariableContext getVariableContext()
          Retrieve the VariableContext.
 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 the FunctionContext.
 void setNamespaceContext(NamespaceContext namespaceContext)
          Set the NamespaceContext.
 void setVariableContext(VariableContext variableContext)
          Set the VariableContext.
 java.lang.String translateNamespacePrefixToUri(java.lang.String prefix)
          Translate a namespace prefix to its URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

functionContext

private transient FunctionContext functionContext
Function context.


namespaceContext

private NamespaceContext namespaceContext
Namespace context.


variableContext

private VariableContext variableContext
Variable context.


navigator

private Navigator navigator
Model navigator.

Constructor Detail

ContextSupport

public ContextSupport()
Construct an empty ContextSupport.


ContextSupport

public ContextSupport(NamespaceContext namespaceContext,
                      FunctionContext functionContext,
                      VariableContext variableContext,
                      Navigator navigator)
Construct.

Parameters:
namespaceContext - The NamespaceContext.
functionContext - The FunctionContext.
variableContext - The VariableContext.
navigator - The model navigator.
Method Detail

setNamespaceContext

public void setNamespaceContext(NamespaceContext namespaceContext)
Set the NamespaceContext.

Parameters:
namespaceContext - The namespace context.

getNamespaceContext

public NamespaceContext getNamespaceContext()
Retrieve the NamespaceContext.

Returns:
The namespace context.

setFunctionContext

public void setFunctionContext(FunctionContext functionContext)
Set the FunctionContext.

Parameters:
functionContext - The function context.

getFunctionContext

public FunctionContext getFunctionContext()
Retrieve the FunctionContext.

Returns:
The function context.

setVariableContext

public void setVariableContext(VariableContext variableContext)
Set the VariableContext.

Parameters:
variableContext - The variable context.

getVariableContext

public VariableContext getVariableContext()
Retrieve the VariableContext.

Returns:
The variable context.

getNavigator

public Navigator getNavigator()
Retrieve the Navigator.

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 naemspace 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 URI.
prefix - The function prefix.
localName - 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 a Function.

Parameters:
namespaceURI - The function namespace URI.
prefix - The function prefix.
localName - The function name.
Returns:
The function object.
Throws:
UnresolvableException - If unable to locate a bound function.