final boolean isListEntity = !isMapEntity && List.class.isAssignableFrom(entityClass);
final PropertyDescriptor dtoFieldDesc = PropertyInspector.getDtoPropertyDescriptorForField(
dtoClass, meta.getDtoFieldName(), dtoPropertyDescriptors);
final MethodSynthesizer synthesizer = context.getMethodSynthesizer();
final MethodSynthesizer entitySynthesizer;
final PropertyDescriptor entityFieldDesc;
if (isMapEntity || isListEntity) {
if (isMapEntity) {
entitySynthesizer = mapSynthesizer;
} else {
entitySynthesizer = listSynthesizer;
}
entityFieldDesc = PropertyInspector.getDtoPropertyDescriptorForField(
dtoClass, meta.getDtoFieldName(), dtoPropertyDescriptors);
} else {
entitySynthesizer = synthesizer;
entityFieldDesc = PropertyInspector.getEntityPropertyDescriptorForField(
dtoClass, entityClass, meta.getDtoFieldName(), meta.getEntityFieldName(), entityPropertyDescriptors);
}
final DataReader entityFieldRead = entitySynthesizer.synthesizeReader(entityFieldDesc);
final DataWriter entityFieldWrite = meta.isReadOnly() ? null : entitySynthesizer.synthesizeWriter(entityFieldDesc);
return new DataPipeChain(
meta.isReadOnly() ? null : synthesizer.synthesizeReader(dtoFieldDesc),
entityFieldRead,
entityFieldWrite, pipe, meta);