Package jakarta.el
Class ExpressionFactory
java.lang.Object
jakarta.el.ExpressionFactory
- Since:
- 2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <T> TcoerceToType(Object obj, Class<T> expectedType) Coerce the supplied object to the requested type.abstract MethodExpressioncreateMethodExpression(ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes) Create a new method expression instance.abstract ValueExpressioncreateValueExpression(ELContext context, String expression, Class<?> expectedType) Create a new value expression.abstract ValueExpressioncreateValueExpression(Object instance, Class<?> expectedType) static ExpressionFactoryCreate a newExpressionFactory.static ExpressionFactorynewInstance(Properties properties) Create a newExpressionFactorypassing in the providedProperties.
-
Constructor Details
-
ExpressionFactory
public ExpressionFactory()
-
-
Method Details
-
newInstance
Create a newExpressionFactory. The class to use is determined by the following search order:- services API (META-INF/services/jakarta.el.ExpressionFactory)
- $JRE_HOME/lib/el.properties - key jakarta.el.ExpressionFactory
- jakarta.el.ExpressionFactory
- Platform default implementation - org.apache.el.ExpressionFactoryImpl
- Returns:
- the new ExpressionFactory
-
newInstance
Create a newExpressionFactorypassing in the providedProperties. Search order is the same asnewInstance().- Parameters:
properties- the properties to be passed to the new instance (may be null)- Returns:
- the new ExpressionFactory
-
createValueExpression
public abstract ValueExpression createValueExpression(ELContext context, String expression, Class<?> expectedType) Create a new value expression.- Parameters:
context- The EL context for this evaluationexpression- The String representation of the value expressionexpectedType- The expected type of the result of evaluating the expression- Returns:
- A new value expression formed from the input parameters
- Throws:
NullPointerException- If the expected type isnullELException- If there are syntax errors in the provided expression
-
createValueExpression
-
createMethodExpression
public abstract MethodExpression createMethodExpression(ELContext context, String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes) Create a new method expression instance.- Parameters:
context- The EL context for this evaluationexpression- The String representation of the method expressionexpectedReturnType- The expected type of the result of invoking the methodexpectedParamTypes- The expected types of the input parameters- Returns:
- A new method expression formed from the input parameters.
- Throws:
NullPointerException- If the expected parameters types arenullELException- If there are syntax errors in the provided expression
-
coerceToType
Coerce the supplied object to the requested type.- Type Parameters:
T- The type to which the object should be coerced- Parameters:
obj- The object to be coercedexpectedType- The type to which the object should be coerced- Returns:
- An instance of the requested type.
- Throws:
ELException- If the conversion fails
-
getStreamELResolver
- Returns:
- This default implementation returns null
- Since:
- EL 3.0
-
getInitFunctionMap
- Returns:
- This default implementation returns null
- Since:
- EL 3.0
-