使用apache的BeanUtils封装数据
来源:互联网 发布:宁波加工中心编程招聘 编辑:程序博客网 时间:2024/04/29 17:06
package cn.lgs.apache.tools;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.locale.converters.DateLocaleConverter;
public class BeanUtilsTest {
public static void main(String[] args) throws IllegalAccessException, InvocationTargetException {
// TODO Auto-generated method stub
Map map = new HashMap<String, Object>();
map.put("username", "lgs");
map.put("password", "111111");
map.put("birthday", "1989-10-01");
Account man = new Account();
BeanUtils bean = new BeanUtils();
ConvertUtils.register(new DateLocaleConverter(), Date.class);
bean.populate(man, map);
System.out.println(man);
}
}
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.locale.converters.DateLocaleConverter;
public class BeanUtilsTest {
public static void main(String[] args) throws IllegalAccessException, InvocationTargetException {
// TODO Auto-generated method stub
Map map = new HashMap<String, Object>();
map.put("username", "lgs");
map.put("password", "111111");
map.put("birthday", "1989-10-01");
Account man = new Account();
BeanUtils bean = new BeanUtils();
ConvertUtils.register(new DateLocaleConverter(), Date.class);
bean.populate(man, map);
System.out.println(man);
}
}
0 0
- 使用apache的BeanUtils封装数据
- Apache Beanutils的使用
- BeanUtils对数据的封装
- apache.commons.beanutils.BeanUtils的使用
- apache Commons-beanutils的使用
- Apache的BeanUtils的使用入门
- apache.commons.beanutils转换器的使用
- 基于表单数据的封装,泛型,反射以及使用BeanUtils进行处理
- Apache Commons beanutils使用
- Apache BeanUtils组件使用
- org.apache.commons.beanutils.BeanUtils使用示例
- 使用commons-beanutils封装请求中的数据与数据类型的转换,web中使用md5和BASE64Encoder加密
- 使用BeanUtils工具封装javaBean
- 使用Apache的BeanUtils进行JavaBean的反射操作
- 使用apache的BeanUtils工具类报异常
- 使用Apache的BeanUtils工具类操作JavaBean属性
- apache-commons之BeanUtils、ConvertUtils、PropertyUtils、CollectionUtils的基本使用
- 用BeanUtils类自动封装表单数据
- static的作用总结
- 自定义优惠券
- Balanced Binary Tree
- AndroidL 导航栏控件使用说明
- POJ3264Balanced Lineup题解-线段树
- 使用apache的BeanUtils封装数据
- Redis整合Spring结合使用缓存实例
- 每个程序员都应牢记的7种坏味道,11种原则,23种模式
- MySQL使用索引的场景及真正利用索引的SQL类型
- 使用七牛云存储的一些经验总结
- c++ 中求反正切的函数atan和atan2的差别?
- 矩阵乘法优化DP
- GIT 学习之路-常用命令
- 用户态驱动--UIO机制的实现