net.christopherschultz.evaluator.util
Class ContextUtil

java.lang.Object
  extended by net.christopherschultz.evaluator.util.ContextUtil

public class ContextUtil
extends Object

Contains utility methods for use with EvaluationContext objects.

Version:
$Revision: 1.5 $ $Date: 2008-06-20 22:58:48 $
Author:
Chris Schultz

Method Summary
static void load(Map props, EvaluationContext ec)
          Loads constants, properties, and functions from the specified Map into the specified EvaluationContext.
static void load(ResourceBundle bundle, EvaluationContext ec)
          Loads constants, properties, and functions from the specified ResourceBundle into the specified EvaluationContext.
static Map toMap(ResourceBundle props)
          Converts a ResourceBundle into a Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

load

public static void load(ResourceBundle bundle,
                        EvaluationContext ec)
Loads constants, properties, and functions from the specified ResourceBundle into the specified EvaluationContext.

Parameters:
bundle - The bundle containing all of the constant, property, and function definitions.
ec - The EvaluationContext into which all the constants, properties, and functions will be placed.

load

public static void load(Map props,
                        EvaluationContext ec)
Loads constants, properties, and functions from the specified Map into the specified EvaluationContext.

Parameters:
props - The property map containing all of the constant, property, and function definitions.
ec - The EvaluationContext into which all the constants, properties, and functions will be placed.

toMap

public static Map toMap(ResourceBundle props)
Converts a ResourceBundle into a Map.

Parameters:
props - A ResourceBundle.
Returns:
A Map containing all keys and values from the ResourceBoudle.