首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

lang包工具种工具类

2012-08-21 
lang包工具类工具类RandomStringUtils类 1 生成10位随机数字字母//BeanUtils对时间转换的初始化设置Conver

lang包工具类工具类
RandomStringUtils类
1 生成10位随机数字字母

//BeanUtils对时间转换的初始化设置ConvertUtils.register(new SqlDateConverter(null), java.sql.Date.class);ConvertUtils.register(new Converter(){SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");SimpleDateFormat sdf_time = new SimpleDateFormat("yyyy-M-d H:m");@SuppressWarnings("rawtypes")public Object convert(Class type, Object value) {if(value == null) return null;if (value instanceof Date) return (value);try {return sdf_time.parse(value.toString());} catch (ParseException e) {try {return sdf.parse(value.toString());} catch (ParseException e1) {return null;}}}}, java.util.Date.class);

热点排行