org.zkoss.xel
Interface ExpressionFactory

All Known Implementing Classes:
ApacheELFactory, ApacheELFactory, ELFactory, MVELFactory, OGNLFactory

public interface ExpressionFactory

Used to prepare expressions (Expression).

Since:
3.0.0
Author:
tomyeh

Field Summary
static int FEATURE_CLASS
          Used with isSupported(int) to know whether the factory supports FunctionMapper.resolveClass(java.lang.String)
static int FEATURE_FUNCTION
          Used with isSupported(int) to know whether the factory supports FunctionMapper.resolveFunction(java.lang.String, java.lang.String)
 
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.
 

Field Detail

FEATURE_FUNCTION

static final int FEATURE_FUNCTION
Used with isSupported(int) to know whether the factory supports FunctionMapper.resolveFunction(java.lang.String, java.lang.String)

See Also:
Constant Field Values

FEATURE_CLASS

static final int FEATURE_CLASS
Used with isSupported(int) to know whether the factory supports FunctionMapper.resolveClass(java.lang.String)

See Also:
Constant Field Values
Method Detail

isSupported

boolean isSupported(int feature)
Returns whether an feature is supported.

Parameters:
feature - which feature to query. It can be a combination of FEATURE_FUNCTION and FEATURE_CLASS.

parseExpression

Expression parseExpression(XelContext ctx,
                           java.lang.String expression,
                           java.lang.Class expectedType)
                           throws XelException
Prepares (aka., compiles) an expression.

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

java.lang.Object evaluate(XelContext ctx,
                          java.lang.String expression,
                          java.lang.Class expectedType)
                          throws XelException
Evaluates an expression.

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-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo