com.plotnix.jex.bexl
Class Interpreter

java.lang.Object
  |
  +--com.plotnix.jex.Interpreter
        |
        +--com.plotnix.jex.bexl.Interpreter

public class Interpreter
extends Interpreter

An Interpreter for the expression language introduced by Jakarta Commons BeanUtils. It understands properties, indexing, dot-separated paths, mapped properties, DynaBeans. See PropertyUtils for the complete description of the language.

Version:
$Revision$
Author:
Dmitri Plotnikov

Constructor Summary
Interpreter()
           
 
Method Summary
 void assign(Context context, java.lang.String expression, java.lang.Object value, java.lang.Object[] arguments)
          Invokes PropertyUtils.setProperty(target, expression, value), where target is passed as the first and only argument.
 java.lang.Object evaluate(Context context, java.lang.String expression, java.lang.Object[] arguments)
          Invokes PropertyUtils.getProperty(target, expression), where target is passed as the first and only argument.
 java.lang.Object evaluate(Context context, java.lang.String expression, java.lang.Object[] arguments, java.lang.Class valueType)
          Invokes PropertyUtils.getProperty(target, expression), where target is passed as the first and only argument.
 java.util.Iterator iterate(Context context, java.lang.String expression, java.lang.Object[] arguments)
          Evaluates the expression, treats the result as a collection and returns an iterator of that collection.
 
Methods inherited from class com.plotnix.jex.Interpreter
getInterpreter, getInterpreterImplementation, validateExpression, validateIterationExpression, validateVariableExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interpreter

public Interpreter()
Method Detail

evaluate

public java.lang.Object evaluate(Context context,
                                 java.lang.String expression,
                                 java.lang.Object[] arguments)
Invokes PropertyUtils.getProperty(target, expression), where target is passed as the first and only argument.
Overrides:
evaluate in class Interpreter
See Also:
Interpreter.evaluate(Context, String, Object[])

evaluate

public java.lang.Object evaluate(Context context,
                                 java.lang.String expression,
                                 java.lang.Object[] arguments,
                                 java.lang.Class valueType)
Invokes PropertyUtils.getProperty(target, expression), where target is passed as the first and only argument.
Overrides:
evaluate in class Interpreter
See Also:
Interpreter.evaluate(Context, String, Object[], Class)

iterate

public java.util.Iterator iterate(Context context,
                                  java.lang.String expression,
                                  java.lang.Object[] arguments)
Evaluates the expression, treats the result as a collection and returns an iterator of that collection.
Overrides:
iterate in class Interpreter
See Also:
Interpreter.iterate(Context, String, Object[])

assign

public void assign(Context context,
                   java.lang.String expression,
                   java.lang.Object value,
                   java.lang.Object[] arguments)
Invokes PropertyUtils.setProperty(target, expression, value), where target is passed as the first and only argument.
Overrides:
assign in class Interpreter
See Also:
Interpreter.assign(Context, String, Object, Object[])


Copyright (c) 2002 - Plotnix, Inc