|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.util.ExpressionEvaluationUtils
public abstract class ExpressionEvaluationUtils
Convenience methods for accessing JSP 2.0's
ExpressionEvaluator.
The evaluation methods check if the value contains "${" before invoking the EL evaluator, treating the value as "normal" expression (i.e. a literal String value) else.
ExpressionEvaluator.evaluate(java.lang.String, java.lang.Class, javax.servlet.jsp.el.VariableResolver, javax.servlet.jsp.el.FunctionMapper)| Field Summary | |
|---|---|
static String |
EXPRESSION_PREFIX
|
static String |
EXPRESSION_SUFFIX
|
| Constructor Summary | |
|---|---|
ExpressionEvaluationUtils()
|
|
| Method Summary | |
|---|---|
static Object |
evaluate(String attrName,
String attrValue,
Class resultClass,
PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to an Object of a given type, |
static Object |
evaluate(String attrName,
String attrValue,
PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to an Object. |
static boolean |
evaluateBoolean(String attrName,
String attrValue,
PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to a boolean. |
static int |
evaluateInteger(String attrName,
String attrValue,
PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to an integer. |
static String |
evaluateString(String attrName,
String attrValue,
PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to a String. |
static boolean |
isExpressionLanguage(String value)
Check if the given expression value is an EL expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String EXPRESSION_PREFIX
public static final String EXPRESSION_SUFFIX
| Constructor Detail |
|---|
public ExpressionEvaluationUtils()
| Method Detail |
|---|
public static boolean isExpressionLanguage(String value)
value - the expression to check
true if the expression is an EL expression,
false otherwise
public static Object evaluate(String attrName,
String attrValue,
Class resultClass,
PageContext pageContext)
throws JspException
attrName - name of the attribute (typically a JSP tag attribute)attrValue - value of the attributeresultClass - class that the result should have (String, Integer, Boolean)pageContext - current JSP PageContext
JspException - in case of parsing errors, also in case of type mismatch
if the passed-in literal value is not an EL expression and not assignable to
the result class
public static Object evaluate(String attrName,
String attrValue,
PageContext pageContext)
throws JspException
attrName - name of the attribute (typically a JSP tag attribute)attrValue - value of the attributepageContext - current JSP PageContext
JspException - in case of parsing errors
public static String evaluateString(String attrName,
String attrValue,
PageContext pageContext)
throws JspException
attrName - name of the attribute (typically a JSP tag attribute)attrValue - value of the attributepageContext - current JSP PageContext
JspException - in case of parsing errors
public static int evaluateInteger(String attrName,
String attrValue,
PageContext pageContext)
throws JspException
attrName - name of the attribute (typically a JSP tag attribute)attrValue - value of the attributepageContext - current JSP PageContext
JspException - in case of parsing errors
public static boolean evaluateBoolean(String attrName,
String attrValue,
PageContext pageContext)
throws JspException
attrName - name of the attribute (typically a JSP tag attribute)attrValue - value of the attributepageContext - current JSP PageContext
JspException - in case of parsing errors
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||