FileDocCategorySizeDatePackage
ExpressionUtil.javaAPI DocGlassfish v2 API3330Sat May 05 19:17:56 BST 2007org.apache.taglibs.standard.tag.el.core

ExpressionUtil

public class ExpressionUtil extends Object

Contains some static utilities to facilitate common forms of expression evaluation.

author
Shawn Bayern

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.ObjectevalNotNull(java.lang.String tagName, java.lang.String attributeName, java.lang.String expression, java.lang.Class expectedType, javax.servlet.jsp.tagext.Tag tag, javax.servlet.jsp.PageContext pageContext)
Evaluates an expression if present, but does not allow the expression to evaluate to 'null', throwing a NullAttributeException if it does. The function can return null, however, if the expression itself is null.

        if (expression != null) {
            Object r = ExpressionEvaluatorManager.evaluate(
                attributeName, expression, expectedType, tag, pageContext);
            if (r == null)
                throw new NullAttributeException(tagName, attributeName);
	    return r;
        } else
	    return null;