net.sf.jec
Class ExpressionCompiler

java.lang.Object
  extended bynet.sf.jec.ExpressionCompiler

public class ExpressionCompiler
extends java.lang.Object

This class precompiles bean expressions so their evaluation becomes faster.

Author:
mballesteros

Constructor Summary
ExpressionCompiler(boolean throwExceptions)
          Creates a new ExpressionCompiler that uses the specified ObjectConverter
 
Method Summary
 void addFunction(java.lang.String name, Function function)
          Adds a new function to the compiler
 void addOperator(java.lang.String name, java.lang.Class operatorClass)
          Adds a new function to the compiler
 Operator compileOperator(java.lang.String expr)
          Compiles an expression into an operator
static ExpressionCompiler getDefaultInstance(boolean throwExceptions)
          Returns an ExpressionCompiler with default operators and functions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionCompiler

public ExpressionCompiler(boolean throwExceptions)
Creates a new ExpressionCompiler that uses the specified ObjectConverter

Method Detail

getDefaultInstance

public static ExpressionCompiler getDefaultInstance(boolean throwExceptions)

Returns an ExpressionCompiler with default operators and functions. It is a convenience method that creates a new ExpressionCompiler and adds all the basic operators and functions with compehensive names. The complete list of added operators and functions is:

Parameters:
throwExceptions -
Returns:
ExpressionCompiler

addOperator

public void addOperator(java.lang.String name,
                        java.lang.Class operatorClass)
Adds a new function to the compiler


addFunction

public void addFunction(java.lang.String name,
                        Function function)
Adds a new function to the compiler


compileOperator

public Operator compileOperator(java.lang.String expr)
                         throws ParseException
Compiles an expression into an operator

Throws:
ParseException


Copyright © 2003 SourceForge. All Rights Reserved.