| | |
| | | |
| | | |
| | | import org.apache.commons.beanutils.BeanUtils; |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * @param orgBean 原始bean |
| | | * @return map对象 |
| | | */ |
| | | public static Map<String, Object> beanCovertMap(Object orgBean) { |
| | | Map<String, Object> newMap = new HashMap<String, Object>(); |
| | | public static Map beanCovertMap(Object orgBean) { |
| | | Map newMap = null; |
| | | |
| | | try { |
| | | BeanUtils.populate(orgBean, newMap); |
| | | newMap = PropertyUtils.describe(orgBean); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("bean转换Map失败", e); |
| | | } |