Package javax.el

Class LambdaExpression

    • Constructor Summary

      Constructors 
      Constructor Description
      LambdaExpression​(java.util.List<java.lang.String> formalParameters, ValueExpression expression)
      Creates a new LambdaExpression.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(java.lang.Object... args)
      Invoke the encapsulated Lambda expression.
      java.lang.Object invoke​(ELContext elContext, java.lang.Object... args)
      Invoke the encapsulated Lambda expression.
      void setELContext​(ELContext context)
      Set the ELContext to use in evaluating the LambdaExpression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LambdaExpression

        public LambdaExpression​(java.util.List<java.lang.String> formalParameters,
                                ValueExpression expression)
        Creates a new LambdaExpression.
        Parameters:
        formalParameters - The list of String representing the formal parameters.
        expression - The ValueExpression representing the body.
    • Method Detail

      • setELContext

        public void setELContext​(ELContext context)
        Set the ELContext to use in evaluating the LambdaExpression. The ELContext must to be set prior to the invocation of the LambdaExpression, unless it is supplied with invoke(javax.el.ELContext, java.lang.Object...).
        Parameters:
        context - The ELContext to use in evaluating the LambdaExpression.
      • invoke

        public java.lang.Object invoke​(ELContext elContext,
                                       java.lang.Object... args)
                                throws ELException
        Invoke the encapsulated Lambda expression.

        The supplied arguments are matched, in the same order, to the formal parameters. If there are more arguments than the formal parameters, the extra arguments are ignored. If there are less arguments than the formal parameters, an ELException is thrown.

        The actual Lambda arguments are added to the ELContext and are available during the evaluation of the Lambda expression. They are removed after the evaluation.

        Parameters:
        elContext - The ELContext used for the evaluation of the expression The ELContext set by setELContext(javax.el.ELContext) is ignored.
        args - The arguments to invoke the Lambda expression. For calls with no arguments, an empty array must be provided. A Lambda argument can be null.
        Returns:
        The result of invoking the Lambda expression
        Throws:
        ELException - if not enough arguments are provided
        java.lang.NullPointerException - is elContext is null
      • invoke

        public java.lang.Object invoke​(java.lang.Object... args)
        Invoke the encapsulated Lambda expression.

        The supplied arguments are matched, in the same order, to the formal parameters. If there are more arguments than the formal parameters, the extra arguments are ignored. If there are less arguments than the formal parameters, an ELException is thrown.

        The actual Lambda arguments are added to the ELContext and are available during the evaluation of the Lambda expression. They are removed after the evaluation.

        The ELContext set by setELContext(javax.el.ELContext) is used in the evaluation of the lambda Expression.
        Parameters:
        args - The arguments to invoke the Lambda expression. For calls with no arguments, an empty array must be provided. A Lambda argument can be null.
        Returns:
        The result of invoking the Lambda expression
        Throws:
        ELException - if not enough arguments are provided