org.basex.query.xpath.func
Class XPathContext

java.lang.Object
  extended by org.basex.query.xpath.func.XPathContext

public final class XPathContext
extends java.lang.Object

Global expression context.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Tim Petrowsky

Method Summary
 Item evalVariable(byte[] name)
          Evaluates a variable.
static XPathContext get()
          Returns single instance of this class.
 Func getFunction(byte[] name, Expr[] args)
          Evaluates the specified function.
 void registerVariable(java.lang.String name, byte[] value)
          Registers a variable.
 void registerVariable(java.lang.String variableName, double value)
          Registers a variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

evalVariable

public Item evalVariable(byte[] name)
                  throws ParseException
Evaluates a variable.

Parameters:
name - name of the variable
Returns:
resulting XPathValue
Throws:
ParseException - parsing exception

get

public static XPathContext get()
Returns single instance of this class.

Returns:
class instance

getFunction

public Func getFunction(byte[] name,
                        Expr[] args)
                 throws ParseException
Evaluates the specified function.

Parameters:
name - name of the function
args - optional arguments
Returns:
resulting XPathValue
Throws:
ParseException - parsing exception

registerVariable

public void registerVariable(java.lang.String name,
                             byte[] value)
Registers a variable.

Parameters:
name - name of the variable.
value - variable as string.

registerVariable

public void registerVariable(java.lang.String variableName,
                             double value)
Registers a variable.

Parameters:
variableName - name of the variable.
value - double value of variable.