Class ExpressionFactoryImpl

java.lang.Object
jakarta.el.ExpressionFactory
org.camunda.bpm.impl.juel.ExpressionFactoryImpl

public class ExpressionFactoryImpl extends jakarta.el.ExpressionFactory
Expression factory implementation. This class is also used as an EL "service provider". The JUEL jar file specifies this class as el expression factory implementation in META-INF/services/jakarta.el.ExpressionFactory. Calling ExpressionFactory.newInstance() will then return an instance of this class, configured as described below. If no properties are specified at construction time, properties are read from
  1. If the file JAVA_HOME/lib/el.properties exists and if it contains property jakarta.el.ExpressionFactory whose value is the name of this class, these properties are taken as default properties.
  2. Otherwise, if system property jakarta.el.ExpressionFactory is set to the name of this class, the system properties System.getProperties() are taken as default properties.
  3. el.properties on your classpath. These properties override the properties from JAVA_HOME/lib/el.properties or System.getProperties().
There are also constructors to explicitly pass in an instance of Properties. Having this, the following properties are read:
  • jakarta.el.cacheSize - cache size (int, default is 1000)
  • jakarta.el.methodInvocations - allow method invocations as in ${foo.bar(baz)} (boolean, default is false).
  • jakarta.el.nullProperties - resolve null properties as in ${foo[null]} (boolean, default is false).
  • jakarta.el.varArgs - support function/method calls using varargs (boolean, default is false).
Author:
Christoph Beck
  • Field Details

  • Constructor Details

    • ExpressionFactoryImpl

      public ExpressionFactoryImpl()
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured from el.properties (see above). The maximum cache size will be 1000 unless overridden in el.properties. The builder profile is ExpressionFactoryImpl.Profile.JEE6 (features may be overridden in el.properties).
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(ExpressionFactoryImpl.Profile profile)
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured from the specified profile and el.properties (see above). The maximum cache size will be 1000 unless overridden in el.properties.
      Parameters:
      profile - builder profile (features may be overridden in el.properties)
      Since:
      2.2
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(Properties properties)
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured using the specified properties. The maximum cache size will be 1000 unless overridden by property jakarta.el.cacheSize. The builder profile is ExpressionFactoryImpl.Profile.JEE6 (features may be overridden in properties).
      Parameters:
      properties - used to initialize this factory (may be null)
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(ExpressionFactoryImpl.Profile profile, Properties properties)
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured using the specified profile and properties. The maximum cache size will be 1000 unless overridden by property jakarta.el.cacheSize.
      Parameters:
      profile - builder profile (individual features may be overridden in properties)
      properties - used to initialize this factory (may be null)
      Since:
      2.2
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(Properties properties, TypeConverter converter)
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured using the specified properties. The maximum cache size will be 1000 unless overridden by property jakarta.el.cacheSize. The builder profile is ExpressionFactoryImpl.Profile.JEE6 (individual features may be overridden in properties).
      Parameters:
      properties - used to initialize this factory (may be null)
      converter - custom type converter
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(ExpressionFactoryImpl.Profile profile, Properties properties, TypeConverter converter)
      Create a new expression factory using the default builder and cache implementations. The builder and cache are configured using the specified profile and properties. The maximum cache size will be 1000 unless overridden by property jakarta.el.cacheSize.
      Parameters:
      profile - builder profile (individual features may be overridden in properties)
      properties - used to initialize this factory (may be null)
      converter - custom type converter
      Since:
      2.2
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(TreeStore store)
      Create a new expression factory.
      Parameters:
      store - the tree store used to parse and cache parse trees.
    • ExpressionFactoryImpl

      public ExpressionFactoryImpl(TreeStore store, TypeConverter converter)
      Create a new expression factory.
      Parameters:
      store - the tree store used to parse and cache parse trees.
      converter - custom type converter
  • Method Details

    • createTreeStore

      protected TreeStore createTreeStore(int defaultCacheSize, ExpressionFactoryImpl.Profile profile, Properties properties)
      Create the factory's tree store. This implementation creates a new tree store using the default builder and cache implementations. The builder and cache are configured using the specified properties. The maximum cache size will be as specified unless overridden by property jakarta.el.cacheSize.
    • createTypeConverter

      protected TypeConverter createTypeConverter(Properties properties)
      Create the factory's type converter. This implementation takes the de.odysseus.el.misc.TypeConverter property as the name of a class implementing the de.odysseus.el.misc.TypeConverter interface. If the property is not set, the default converter (TypeConverter.DEFAULT) is used.
    • createTreeBuilder

      protected TreeBuilder createTreeBuilder(Properties properties, Builder.Feature... features)
      Create the factory's builder. This implementation takes the de.odysseus.el.tree.TreeBuilder property as a name of a class implementing the de.odysseus.el.tree.TreeBuilder interface. If the property is not set, a plain de.odysseus.el.tree.impl.Builder is used. If the configured class is a subclass of de.odysseus.el.tree.impl.Builder and which provides a constructor taking an array of Builder.Feature, this constructor will be invoked. Otherwise, the default constructor will be used.
    • coerceToType

      public Object coerceToType(Object obj, Class<?> targetType)
    • createValueExpression

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

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

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