Package org.apache.taglibs.standard.util
Class ExpressionUtil
- java.lang.Object
-
- org.apache.taglibs.standard.util.ExpressionUtil
-
public class ExpressionUtil extends java.lang.Object
Helper functions for working with EL expressions.
-
-
Constructor Summary
Constructors Constructor Description ExpressionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValueExpression
createValueExpression(PageContext pageContext, java.lang.String expression, java.lang.Class<?> expectedType)
Create a value expression.static <T> T
evaluate(ValueExpression expression, PageContext pageContext)
Evaluate a value expression.static boolean
evaluate(ValueExpression expression, PageContext pageContext, boolean fallback)
static int
evaluate(ValueExpression expression, PageContext pageContext, int fallback)
static ExpressionFactory
getExpressionFactory(PageContext pageContext)
Return the JSP's ExpressionFactory.
-
-
-
Method Detail
-
createValueExpression
public static ValueExpression createValueExpression(PageContext pageContext, java.lang.String expression, java.lang.Class<?> expectedType)
Create a value expression.- Parameters:
pageContext
- the context in which the expression will be parsedexpression
- the expressionexpectedType
- the expected type of result- Returns:
- a parsed expression
-
getExpressionFactory
public static ExpressionFactory getExpressionFactory(PageContext pageContext)
Return the JSP's ExpressionFactory.- Parameters:
pageContext
- the context for the JSP- Returns:
- the ExpressionFactory to use for EL expressions in that JSP
-
evaluate
public static <T> T evaluate(ValueExpression expression, PageContext pageContext)
Evaluate a value expression. To support optional attributes, if the expression is null then null will be returned.- Type Parameters:
T
- the expected type of the expression- Parameters:
expression
- the expressionpageContext
- the context for the JSP- Returns:
- the result of evaluating the expression
-
evaluate
public static boolean evaluate(ValueExpression expression, PageContext pageContext, boolean fallback)
-
evaluate
public static int evaluate(ValueExpression expression, PageContext pageContext, int fallback)
-
-