FileDocCategorySizeDatePackage
Evaluator.javaAPI DocGlassfish v2 API5686Sat May 05 19:17:26 BST 2007org.apache.taglibs.standard.lang.jstl

Evaluator

public class Evaluator extends Object implements org.apache.taglibs.standard.lang.support.ExpressionEvaluator

This 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.

author
Nathan Abramson - Art Technology Group
author
Shawn Bayern
version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: tcfujii $

Fields Summary
static ELEvaluator
sEvaluator
The singleton instance of the evaluator
Constructors Summary
Methods Summary
public java.lang.Objectevaluate(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.Objectevaluate(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.StringparseAndRender(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.Stringvalidate(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 ()
	 });
    }