Class Overview
Convenience methods for accessing JSP 2.0's
javax.servlet.jsp.el.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.
See Also
- javax.servlet.jsp.el.ExpressionEvaluator#evaluate
Summary
Public Methods |
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
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
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.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Constants
public
static
final
String
EXPRESSION_PREFIX
public
static
final
String
EXPRESSION_SUFFIX
Public Constructors
public
ExpressionEvaluationUtils
()
Public Methods
public
static
Object
evaluate
(String attrName, String attrValue, PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to an Object.
Parameters
attrName
| name of the attribute (typically a JSP tag attribute) |
attrValue
| value of the attribute |
pageContext
| current JSP PageContext |
Returns
- the result of the evaluation
Throws
| in case of parsing errors
|
JspException
| |
public
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,
Parameters
attrName
| name of the attribute (typically a JSP tag attribute) |
attrValue
| value of the attribute |
resultClass
| class that the result should have (String, Integer, Boolean) |
pageContext
| current JSP PageContext |
Returns
- the result of the evaluation
Throws
| 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
|
JspException
| |
public
static
boolean
evaluateBoolean
(String attrName, String attrValue, PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to a boolean.
Parameters
attrName
| name of the attribute (typically a JSP tag attribute) |
attrValue
| value of the attribute |
pageContext
| current JSP PageContext |
Returns
- the result of the evaluation
Throws
| in case of parsing errors
|
JspException
| |
public
static
int
evaluateInteger
(String attrName, String attrValue, PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to an integer.
Parameters
attrName
| name of the attribute (typically a JSP tag attribute) |
attrValue
| value of the attribute |
pageContext
| current JSP PageContext |
Returns
- the result of the evaluation
Throws
| in case of parsing errors
|
JspException
| |
public
static
String
evaluateString
(String attrName, String attrValue, PageContext pageContext)
Evaluate the given expression (be it EL or a literal String value) to a String.
Parameters
attrName
| name of the attribute (typically a JSP tag attribute) |
attrValue
| value of the attribute |
pageContext
| current JSP PageContext |
Returns
- the result of the evaluation
Throws
| in case of parsing errors
|
JspException
| |
public
static
boolean
isExpressionLanguage
(String value)
Check if the given expression value is an EL expression.
Parameters
value
| the expression to check |
Returns
true
if the expression is an EL expression,
false
otherwise