Class CompiledELContext

java.lang.Object
jakarta.el.ELContext
io.micronaut.el.CompiledELContext

public class CompiledELContext extends jakarta.el.ELContext
A standalone ELContext backed by the resolvers generated at compilation time.

The functions of the compiled expressions are bound at compilation time, therefore the function mapper of this context resolves nothing.

Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • CompiledELContext

      public CompiledELContext()
      Creates a context using the standard chain of resolvers.
    • CompiledELContext

      public CompiledELContext(jakarta.el.ELResolver... first)
      Parameters:
      first - The resolvers consulted before the standard ones
  • Method Details

    • resolveBean

      public @Nullable Object resolveBean(String name)
      Resolves a declared variable the way ELResolution.resolveVariable does, from the beans of this context directly when nothing can shadow them: no lambda scope is open and the variable mapper holds no variable.
      Parameters:
      name - The name of the variable
      Returns:
      The bean, or null when the name is not a bean of this context or may be shadowed, in which case the resolution goes through the mapper and the resolvers
    • isLambdaArgument

      public boolean isLambdaArgument(String arg)
      Overrides:
      isLambdaArgument in class jakarta.el.ELContext
    • addEvaluationListener

      public void addEvaluationListener(jakarta.el.EvaluationListener listener)
      Overrides:
      addEvaluationListener in class jakarta.el.ELContext
    • notifyBeforeEvaluation

      public void notifyBeforeEvaluation(String expression)
      Overrides:
      notifyBeforeEvaluation in class jakarta.el.ELContext
    • notifyAfterEvaluation

      public void notifyAfterEvaluation(String expression)
      Overrides:
      notifyAfterEvaluation in class jakarta.el.ELContext
    • notifyPropertyResolved

      public void notifyPropertyResolved(@Nullable Object base, @Nullable Object property)
      Overrides:
      notifyPropertyResolved in class jakarta.el.ELContext
    • enterLambdaScope

      public void enterLambdaScope(Map<String,Object> args)
      Overrides:
      enterLambdaScope in class jakarta.el.ELContext
    • exitLambdaScope

      public void exitLambdaScope()
      Overrides:
      exitLambdaScope in class jakarta.el.ELContext
    • setBean

      public CompiledELContext setBean(String name, @Nullable Object value)
      Defines a bean resolvable by its name.
      Parameters:
      name - The name
      value - The value
      Returns:
      This context
    • getBean

      public @Nullable Object getBean(String name)
      Parameters:
      name - The name
      Returns:
      The bean of the given name
    • getELResolver

      public jakarta.el.ELResolver getELResolver()
      Specified by:
      getELResolver in class jakarta.el.ELContext
    • getFunctionMapper

      public jakarta.el.FunctionMapper getFunctionMapper()
      Specified by:
      getFunctionMapper in class jakarta.el.ELContext
    • getVariableMapper

      public jakarta.el.VariableMapper getVariableMapper()
      Specified by:
      getVariableMapper in class jakarta.el.ELContext