Class<?> srcType = classMap.getSrcClassToMap();
PropertyDescriptor[] srcProperties = ReflectionUtils.getPropertyDescriptors(srcType);
for (PropertyDescriptor property : srcProperties) {
Method readMethod = property.getReadMethod();
if (readMethod != null) {
Mapping mapping = readMethod.getAnnotation(Mapping.class);
String propertyName = property.getName();
if (mapping != null) {
validate(mapping, readMethod);
String pairName = mapping.value();
addGenericMapping(classMap, configuration, propertyName, pairName);
}
}
}
Class<?> destType = classMap.getDestClassToMap();
PropertyDescriptor[] destProperties = ReflectionUtils.getPropertyDescriptors(destType);
for (PropertyDescriptor property : destProperties) {
Method readMethod = property.getReadMethod();
if (readMethod != null) {
Mapping mapping = readMethod.getAnnotation(Mapping.class);
String propertyName = property.getName();
if (mapping != null) {
validate(mapping, readMethod);
String pairName = mapping.value();
addGenericMapping(classMap, configuration, pairName, propertyName);
}
}
}