public static Map<String, Object> beanToMap(Object bean) {
        if (bean == null) return null;
        Map<String, Object> ret = new HashMap<String, Object>();
        try{
            Class<?> cls = bean.getClass();
            BeanInfo bi = Introspector.getBeanInfo(cls);
            for (PropertyDescriptor pd : bi.getPropertyDescriptors()) {
                if ("class".equals(pd.getName())) continue;
                Method readMethod = pd.getReadMethod();
                if (readMethod == null) {
                    continue;
                }
                ret.put(pd.getName(), readMethod.invoke(bean));
            }
        }catch(Exception e){
            throw new RuntimeException("Method beanToMap has cause a exception", e);
        }
        return ret;
    }