一个JavaBean往另一个JavaBean赋值(属性名大小写不同)
PropertyDescriptor[] property = PropertyUtils.getPropertyDescriptors(target);for (int i = 0; i < property.length; i++) { String propertyTarget = property[i].getName(); String propertyName = propertyTarget.toLowerCase(); if (PropertyUtils.isWriteable(source, propertyName)) { Object propertyValue = PropertyUtils.getProperty(source, propertyName); if (!(propertyValue instanceof String) && propertyValue != null) { propertyValue = String.valueOf(propertyValue); } PropertyUtils.setProperty(target, propertyTarget, propertyValue); }}