org.displaytag.tags.el
Class ExpressionEvaluator

java.lang.Object
  extended byorg.displaytag.tags.el.ExpressionEvaluator

public class ExpressionEvaluator
extends java.lang.Object

Utility class to help with the evaluation of JSTL Expression Language. It mainly encapsulates the calls to ExpressionEvaluationManager to ease the use of this class.

Version:
$Revision: 1.6 $ ($Author: fgiust $)
Author:
Tim McCune, Fabrizio Giustina

Constructor Summary
ExpressionEvaluator(javax.servlet.jsp.tagext.Tag sourceTag, javax.servlet.jsp.PageContext context)
          Creates a new ExpressionEvaluator for the given tag and pagecontext.
 
Method Summary
 java.lang.Object eval(java.lang.String attrName, java.lang.String attrValue, java.lang.Class returnClass)
          Evaluate expression in attrValue.
 boolean evalBoolean(java.lang.String attrName, java.lang.String attrValue)
          Evaluate expression in attrValueas as a boolean.
 int evalInt(java.lang.String attrName, java.lang.String attrValue)
          Evaluate expression in attrValueas as a int.
 long evalLong(java.lang.String attrName, java.lang.String attrValue)
          Evaluate expression in attrValueas as a long.
 java.lang.String evalString(java.lang.String attrName, java.lang.String attrValue)
          Evaluate expression in attrValueas as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionEvaluator

public ExpressionEvaluator(javax.servlet.jsp.tagext.Tag sourceTag,
                           javax.servlet.jsp.PageContext context)
Creates a new ExpressionEvaluator for the given tag and pagecontext.

Parameters:
sourceTag - tag where the expression has to be evaluated
context - the page context
Method Detail

eval

public java.lang.Object eval(java.lang.String attrName,
                             java.lang.String attrValue,
                             java.lang.Class returnClass)
                      throws javax.servlet.jsp.JspException
Evaluate expression in attrValue.

Parameters:
attrName - attribute name
attrValue - attribute value
returnClass - class the returned object is instance of
Returns:
evaluate expression of attrValue, null if attrValue is null.
Throws:
javax.servlet.jsp.JspException - exception thrown by ExpressionEvaluatorManager

evalString

public java.lang.String evalString(java.lang.String attrName,
                                   java.lang.String attrValue)
                            throws javax.servlet.jsp.JspException
Evaluate expression in attrValueas as a String.

Parameters:
attrName - attribute name
attrValue - attribute value
Returns:
evaluate expression of attrValue, null if attrValue is null.
Throws:
javax.servlet.jsp.JspException - exception thrown by ExpressionEvaluatorManager

evalBoolean

public boolean evalBoolean(java.lang.String attrName,
                           java.lang.String attrValue)
                    throws javax.servlet.jsp.JspException
Evaluate expression in attrValueas as a boolean.

Parameters:
attrName - attribute name
attrValue - attribute value
Returns:
evaluate expression of attrValue, false if attrValue is null.
Throws:
javax.servlet.jsp.JspException - exception thrown by ExpressionEvaluatorManager

evalLong

public long evalLong(java.lang.String attrName,
                     java.lang.String attrValue)
              throws javax.servlet.jsp.JspException
Evaluate expression in attrValueas as a long.

Parameters:
attrName - attribute name
attrValue - attribute value
Returns:
evaluate expression of attrValue, -1 if attrValue is null.
Throws:
javax.servlet.jsp.JspException - exception thrown by ExpressionEvaluatorManager

evalInt

public int evalInt(java.lang.String attrName,
                   java.lang.String attrValue)
            throws javax.servlet.jsp.JspException
Evaluate expression in attrValueas as a int.

Parameters:
attrName - attribute name
attrValue - attribute value
Returns:
evaluate expression of attrValue, -1 if attrValue is null.
Throws:
javax.servlet.jsp.JspException - exception thrown by ExpressionEvaluatorManager


Copyright © 2002-2005 the Displaytag team. All Rights Reserved.