📄 listisemptytag.java
字号:
/*
* $Id: ListIsEmptyTag.java,v 1.1 2001/10/18 00:46:05 ro89390 Exp $
* Copyright 2001 Sun Microsystems, Inc. All rights reserved.
*/
package com.sure.taglibs.list;
import com.sure.taglibs.smart.*;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import java.util.Collection;
/**
* A conditional tag returning whether a list is empty.
*/
public class ListIsEmptyTag extends ConditionalTag {
protected boolean doTest(Object o) throws JspTagException {
if (o == null) {
return true;
}
else if (o instanceof Collection) {
return ((Collection) o).isEmpty();
}
else {
throw new JspTagException("ListIsEmptyTag: Not a Collection.");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -