common-lang (2.1) | |
ArrayUtils | 常量中包含了基本类型(及其相对应类)的空数组。 提供向数组增加元素(包括增加单个元素或是整个数组),删除元素,翻转元素排列次序 克隆数组(基本类型) 查找数组中的元素(是否包含,返回索引) 获得数组长度(null安全,返回为0) 数组是否为空,数组是否相等,长度是否相等,元素类型是否相同, 基本类型对应类数组转换成基本类型数组 转成字符串 |
BooleanUtils | Boolean的转换(可转成int,String)
|
CharUtils | 针对Char的工具类包括判断是不是ASCII字符,是不是控制符可打印与否,转成整形 |
ClassUtils | 获得包名,获得类的所有超类。 |
RandomStringUtils | 随机字符串生成,可生成数字串,也可生成Ascii范围的字串 |
StringEscapeUtils | 编码/解码针对xml/html/sql/javascript/java(主要是转义标记符号等) |
StringUtils | String的增强。类似vb的函数。截断、查找、替换、判断空、大小写、合并、分割,反写,对比 |
SerializationUtils | 序列化工具类,将类转序列或反序列 |
SystemUtils | 系统工具类,判断JRE版本,判断操作系统,判断字体(AWT),获得JAVA_HOME(及相关的所有环境变量),操作系统版本,时区、当前用户名,获得用户文件夹 |
Validate | 校验器,判断集合里面所有的对象是否是某类,判断集合里面所有对象都非空,判断集合是否为空,判断数组、Map或字符串是否为空 |
WordUtils | 将一个字符串中的单词首字大写;根据提供的每行字数将一个字符串断行 |
ToStringBuilder | toString方法的增强类,可将对象转成字符串(除了打出引用地址还会打出所有属性)可设置显示的风格(ToStringStyle,抽象类,需继承实现后方可使用) |
EqualsBuilder | 相等判断,例如以下语句: a = b == c a = a && e == f 可转换成 a = new EqualsBuilder() .append( b,c ) .append( e,f) .isEquals(); |
HashCodeBuilder | 获得哈希值 |
Enum | 枚举型,看来会被5.0替代. |
ExceptionUtils | 对异常的常见操作,获得堆栈,异常抛出方法名,错误链中对象数(要这个干吗???) |
RandomUtils | 随机数据生成类,包括浮点,双精,布尔,整形,长整在内的随机数生成 |
NumberUtils | 常用数字函数,最大值,最小值,字符串和数值转换 |
DateFormatUtils | 格式化日期时间,支持默认格式(即常量格式)如下: ISO8601 (包含时区和不包含时区) SMTP数据头格式 |
DateUtils | 日期工具类,对比日期,削去部分数据,没啥用… |
FastDateFormat | SimpleDateFormat的线程安全版本,听说速度更快… |
StopWatch | 秒表,监控运行时间的常用工具. |
common-beanutils (1.7) | |
BeanUtils | 克隆一个对象甚至他自身并未实现克隆方法 复制一个对象的属性至另一个对象 复制一个对象的指定属性至另一个对象 将一个对象的所有属性都到一个Map 获得一个对象的一个数组属性 直接访问对象的Map类型的属性中的元素 将一个Map对象的键值复制到目标对象的相应属性 |
ConstructorUtils | 从一个类获得其构造器 |
DynaBean | 动态Bean。 |
Validator 1.1.4 看样子是从Struts里面剥离出来的,用用其工具类就OK了。其他的太繁琐。 | |
CreditCardValidator | 信用卡校验 |
DateValidator | 日期校验,可根据给的日期模板(SimpleDateFormat)校验 |
EmailValidator | 校验电子邮件,可以校验域名、用户名 |
GenericTypeValidator | 将字符串转换成Int/Double/Float/Long/Date/Byte |
GenericValidator | 常用校验器(静态方法),包括:字符串是否为空或者为null,字符串是否为byte。是否为信用卡,是否为日期(根据模板),是否为浮点数,是否为电邮,是否为双精数,是否在数值范围(类型:浮点,双精,整,长整,端整,字节),是否为URL,是否符合正则表达式,字符串是否超长,数值是否超过指定值,字符串是否过短,数值是否低于指定值。 |
ISBNValidator | ISBN校验器 |
UrlValidator | URL校验器 |
Validator | 校验器(需实例化),和资源文件关联 |