common-util

local.tomas.expr.eval
Class ExpressionContext

java.lang.Object
  extended by local.tomas.expr.eval.ExpressionContext

public class ExpressionContext
extends Object

Context used for expression evaluations. The context is primarily used to store the names of variables with their values.

Author:
tomas

Field Summary
protected  Map<String,ExpressionValue> variableValues
          Maps variable names to their values.
 
Constructor Summary
ExpressionContext()
          Default constructor.
ExpressionContext(Map<String,ExpressionValue> variableValues)
          Construct context from a map of variables.
 
Method Summary
 ExpressionValue getVariableValue(String name)
          Get value of variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

variableValues

protected Map<String,ExpressionValue> variableValues
Maps variable names to their values.

Constructor Detail

ExpressionContext

public ExpressionContext(Map<String,ExpressionValue> variableValues)
Construct context from a map of variables.

Parameters:
variableValues - maps the variable names to their values

ExpressionContext

public ExpressionContext()
Default constructor. No variables are defined.

Method Detail

getVariableValue

public ExpressionValue getVariableValue(String name)
                                 throws ExpressionException
Get value of variable.

Parameters:
name - variable name
Returns:
the value
Throws:
ExpressionException - if variable is undefined

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.