Class CompiledExpressionFactory

java.lang.Object
jakarta.el.ExpressionFactory
io.micronaut.el.CompiledExpressionFactory

public class CompiledExpressionFactory extends jakarta.el.ExpressionFactory
The ExpressionFactory returning the expressions compiled at compilation time.

The factory does not parse expressions at runtime. An expression that was not compiled, and that is not a literal-expression, cannot be created.

Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • CompiledExpressionFactory

      public CompiledExpressionFactory()
      Creates a factory loading the generated expression sources with the SoftServiceLoader.

      The sources are loaded with the context class loader of the thread, which is the loader ExpressionFactory.newInstance() locates this factory with, so that the expressions generated into a class loader that is a child of the one holding this class — a deployment, a plugin, an isolated test — are found. The loader of this class is used when the thread has none.

    • CompiledExpressionFactory

      public CompiledExpressionFactory(ClassLoader classLoader)
      Creates a factory loading the generated expression sources from the given class loader.
      Parameters:
      classLoader - The class loader holding the generated sources and the optional parser
    • CompiledExpressionFactory

      public CompiledExpressionFactory(List<ELExpressionSource> sources)
      Parameters:
      sources - The expression sources
    • CompiledExpressionFactory

      public CompiledExpressionFactory(List<ELExpressionSource> sources, @Nullable ELExpressionParser parser)
      Parameters:
      sources - The expression sources
      parser - The parser creating the expressions that were not compiled, can be null
  • Method Details

    • createValueExpression

      public jakarta.el.ValueExpression createValueExpression(jakarta.el.ELContext context, String expression, Class<?> expectedType)
      Specified by:
      createValueExpression in class jakarta.el.ExpressionFactory
    • createValueExpression

      public jakarta.el.ValueExpression createValueExpression(Object instance, Class<?> expectedType)
      Specified by:
      createValueExpression in class jakarta.el.ExpressionFactory
    • createMethodExpression

      public jakarta.el.MethodExpression createMethodExpression(jakarta.el.ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes)
      Specified by:
      createMethodExpression in class jakarta.el.ExpressionFactory
    • coerceToType

      public <T> @Nullable T coerceToType(@Nullable Object obj, @Nullable Class<T> targetType)
      Specified by:
      coerceToType in class jakarta.el.ExpressionFactory
    • getStreamELResolver

      public jakarta.el.ELResolver getStreamELResolver()
      Overrides:
      getStreamELResolver in class jakarta.el.ExpressionFactory
    • getInitFunctionMap

      public Map<String,Method> getInitFunctionMap()
      Overrides:
      getInitFunctionMap in class jakarta.el.ExpressionFactory