FileDocCategorySizeDatePackage
AstEmpty.javaAPI DocApache Tomcat 6.0.141300Fri Jul 20 04:20:34 BST 2007org.apache.el.parser

AstEmpty

public final class AstEmpty extends SimpleNode
author
Jacob Hookom [jacob@hookom.net]
version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: markt $

Fields Summary
Constructors Summary
public AstEmpty(int id)

        super(id);
    
Methods Summary
public java.lang.ClassgetType(org.apache.el.lang.EvaluationContext ctx)

        return Boolean.class;
    
public java.lang.ObjectgetValue(org.apache.el.lang.EvaluationContext ctx)

        Object obj = this.children[0].getValue(ctx);
        if (obj == null) {
            return Boolean.TRUE;
        } else if (obj instanceof String) {
            return Boolean.valueOf(((String) obj).length() == 0);
        } else if (obj instanceof Object[]) {
            return Boolean.valueOf(((Object[]) obj).length == 0);
        } else if (obj instanceof Collection) {
            return Boolean.valueOf(((Collection) obj).isEmpty());
        } else if (obj instanceof Map) {
            return Boolean.valueOf(((Map) obj).isEmpty());
        }
        return Boolean.FALSE;