org.planx.xpath
Class Environment

java.lang.Object
  extended by org.planx.xpath.Environment

public class Environment
extends Object

An XPath context environment.


Constructor Summary
Environment()
          Create an empty environment with only core functions and no variables bound.
 
Method Summary
 void bindFunction(String funcName, Function func)
          Binds the specified function to the specified function name in this environment.
 void bindFunctions(Map functions)
          Binds all the functions in the specified map to the function names under which they are stored in the map.
 void bindVariable(String varName, XObject value)
          Binds the specified variable to the specified variable name in this environment.
 void bindVariables(Map variables)
          Binds all the variables in the specified map to the variable names under which they are stored in the map.
 Function getFunction(String funcName)
          Returns the function bound to the specified name.
 XObject getVariable(String varName)
          Returns the value bound to the specified variable name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Environment

public Environment()
Create an empty environment with only core functions and no variables bound.

Method Detail

bindFunction

public void bindFunction(String funcName,
                         Function func)
Binds the specified function to the specified function name in this environment. If a function is already bound to the specified name, that function is replaced.


bindFunctions

public void bindFunctions(Map functions)
Binds all the functions in the specified map to the function names under which they are stored in the map. The map must consist of (String, Function) key-value pairs.


getFunction

public Function getFunction(String funcName)
                     throws XPathException
Returns the function bound to the specified name. If no function is bound to the name an XPathException is thrown.

Throws:
XPathException

bindVariable

public void bindVariable(String varName,
                         XObject value)
Binds the specified variable to the specified variable name in this environment. If a variable is already bound to the specified name, the value is replaced.


bindVariables

public void bindVariables(Map variables)
Binds all the variables in the specified map to the variable names under which they are stored in the map. The map must consist of (String, XObject) key-value pairs.


getVariable

public XObject getVariable(String varName)
                    throws XPathException
Returns the value bound to the specified variable name. If no value is bound to the name an XPathException is thrown.

Throws:
XPathException


Copyright © 2010. All Rights Reserved.