FileDocCategorySizeDatePackage
AstEmpty.javaAPI DocGlassfish v2 API3129Fri May 04 22:31:20 BST 2007com.sun.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: tcfujii $

Fields Summary
Constructors Summary
public AstEmpty(int id)

        super(id);
    
Methods Summary
public java.lang.ClassgetType(com.sun.el.lang.EvaluationContext ctx)

        return Boolean.class;
    
public java.lang.ObjectgetValue(com.sun.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;