Class ApacheELFactory

  • All Implemented Interfaces:
    ExpressionFactory

    public class ApacheELFactory
    extends java.lang.Object
    implements ExpressionFactory
    An implementation based on org.apache.el.ExpressionFactoryImpl.

    Available in ZK EE

    Since:
    3.0.0
    Author:
    tomyeh
    • Constructor Detail

      • ApacheELFactory

        public ApacheELFactory()
    • Method Detail

      • parseExpression

        public Expression parseExpression​(XelContext xelc,
                                          java.lang.String expression,
                                          java.lang.Class expectedType)
                                   throws XelException
        Description copied from interface: ExpressionFactory
        Prepares (a.k.a., compiles) an expression.
        Specified by:
        parseExpression in interface ExpressionFactory
        Parameters:
        xelc - the context information 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 xelc,
                                         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:
        xelc - 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 }, regardless of what implementation is used.
        expectedType - the expected type of the result of the evaluation
        Throws:
        XelException
      • newExpressionFactory

        protected javax.el.ExpressionFactory newExpressionFactory()
        Returns the EL expression factory.

        Default: Use org.apache.el.ExpressionFactoryImpl.

        You might override it to use a different implementation.