⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basecommand.java.svn-base

📁 EasyJWeb是基于java技术
💻 SVN-BASE
字号:
package com.easyjf.core.support;import java.util.ArrayList;import java.util.List;abstract public class BaseCommand implements ICommand {	protected List<String> errors = new ArrayList<String>();	public void notNull(Object obj, String name) {		if (obj == null) {			errors.add(name + "不能为空");		}		if (obj instanceof String) {			String str = (String) obj;			if (str.trim().equals("")) {				errors.add(name + "不能为空");			}		}	}	public void isNumber(Object obj, String name) {		this.notNull(obj, name);		String str = obj == null ? "" : obj.toString();		boolean ret = str.matches("\\d*");		if (!ret) {			errors.add(name + "必须为数字");		}	}	public void isString(Object obj, String name) {		this.notNull(obj, name);		String str = (String) obj;		boolean ret = str.matches("\\w*");		if (!ret) {			errors.add(name + "必须为文本");		}	}	abstract public List<String> vaild();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -