org.zkoss.zkmax.xel.mvel
Class MVELFactory

java.lang.Object
  extended by org.zkoss.zkmax.xel.mvel.MVELFactory
All Implemented Interfaces:
ExpressionFactory

public class MVELFactory
extends java.lang.Object
implements ExpressionFactory

An implementation based on MVEL.

Available in ZK EE

Note: MVEL is not completely compatible with JSP EL.

See also MVEL website.

Since:
3.0.0
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.xel.ExpressionFactory
FEATURE_CLASS, FEATURE_FUNCTION
 
Constructor Summary
MVELFactory()
           
 
Method Summary
 java.lang.Object evaluate(XelContext ctx, java.lang.String expression, java.lang.Class expectedType)
          Evaluates an expression.
 boolean isSupported(int feature)
          Returns whether an feature is supported.
 Expression parseExpression(XelContext ctx, java.lang.String expression, java.lang.Class expectedType)
          Prepares (aka., compiles) an expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVELFactory

public MVELFactory()
Method Detail

isSupported

public boolean isSupported(int feature)
Description copied from interface: ExpressionFactory
Returns whether an feature is supported.

Specified by:
isSupported in interface ExpressionFactory
Parameters:
feature - which feature to query. It can be a combination of ExpressionFactory.FEATURE_FUNCTION and ExpressionFactory.FEATURE_CLASS.

parseExpression

public Expression parseExpression(XelContext ctx,
                                  java.lang.String expression,
                                  java.lang.Class expectedType)
                           throws XelException
Description copied from interface: ExpressionFactory
Prepares (aka., compiles) an expression.

Specified by:
parseExpression in interface ExpressionFactory
Parameters:
ctx - the context infomation to prepare the expression. It can be null, in which case no functions are supported for this invocation.
expression - the expression to be evaluated.
expectedType - the expected type of the result of the evaluation
Throws:
XelException

evaluate

public java.lang.Object evaluate(XelContext ctx,
                                 java.lang.String expression,
                                 java.lang.Class expectedType)
                          throws XelException
Description copied from interface: ExpressionFactory
Evaluates an expression.

Specified by:
evaluate in interface ExpressionFactory
Parameters:
ctx - the context information to evaluate an expression. It can be null, in which case no functions are supported for this invocation.
expression - the expression to be evaluated. Note: the expression is enclosed with ${ and }, regardingless what implemetnation is used.
expectedType - the expected type of the result of the evaluation
Throws:
XelException


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo