Evaluatorpublic class Evaluator extends Object implements org.apache.taglibs.standard.lang.support.ExpressionEvaluatorThis is the expression evaluator "adapter" that customizes it
for use with the JSP Standard Tag Library. It uses a
VariableResolver implementation that looks up variables from the
PageContext and also implements its implicit objects. It also
wraps ELExceptions in JspExceptions that describe the attribute
name and value causing the error. |
Fields Summary |
---|
static ELEvaluator | sEvaluatorThe singleton instance of the evaluator |
Methods Summary |
---|
public java.lang.Object | evaluate(java.lang.String pAttributeName, java.lang.String pAttributeValue, java.lang.Class pExpectedType, javax.servlet.jsp.tagext.Tag pTag, javax.servlet.jsp.PageContext pPageContext, java.util.Map functions, java.lang.String defaultPrefix)Evaluates the expression at request time
try {
return sEvaluator.evaluate
(pAttributeValue,
pPageContext,
pExpectedType,
functions,
defaultPrefix);
}
catch (ELException exc) {
throw new JspException
(MessageFormat.format
(Constants.ATTRIBUTE_EVALUATION_EXCEPTION,
new Object [] {
"" + pAttributeName,
"" + pAttributeValue,
exc.getMessage(),
exc.getRootCause()
}), exc.getRootCause());
}
| public java.lang.Object | evaluate(java.lang.String pAttributeName, java.lang.String pAttributeValue, java.lang.Class pExpectedType, javax.servlet.jsp.tagext.Tag pTag, javax.servlet.jsp.PageContext pPageContext)Conduit to old-style call for convenience.
return evaluate(pAttributeName,
pAttributeValue,
pExpectedType,
pTag,
pPageContext,
null,
null);
| public static java.lang.String | parseAndRender(java.lang.String pAttributeValue)Parses the given attribute value, then converts it back to a
String in its canonical form.
try {
return sEvaluator.parseAndRender (pAttributeValue);
}
catch (ELException exc) {
throw new JspException
(MessageFormat.format
(Constants.ATTRIBUTE_PARSE_EXCEPTION,
new Object [] {
"test",
"" + pAttributeValue,
exc.getMessage ()
}));
}
| public java.lang.String | validate(java.lang.String pAttributeName, java.lang.String pAttributeValue)Translation time validation of an attribute value. This method
will return a null String if the attribute value is valid;
otherwise an error message.
//-------------------------------------
// ExpressionEvaluator methods
//-------------------------------------
try {
sEvaluator.parseExpressionString (pAttributeValue);
return null;
}
catch (ELException exc) {
return
MessageFormat.format
(Constants.ATTRIBUTE_PARSE_EXCEPTION,
new Object [] {
"" + pAttributeName,
"" + pAttributeValue,
exc.getMessage ()
});
}
|
|