AnnotationValidatingBindingException, GeDARuntimeException {
final PropertyDescriptor dtoFieldDesc = PropertyInspector.getDtoPropertyDescriptorForField(
dtoClass, meta.getDtoFieldName(), dtoPropertyDescriptors);
final MethodSynthesizer synthesizer = context.getMethodSynthesizer();
final DataReader dtoFieldRead = meta.isReadOnly() ? null : synthesizer.synthesizeReader(dtoFieldDesc);
final DataWriter dtoFieldWrite = synthesizer.synthesizeWriter(dtoFieldDesc);
final boolean isMapEntity = Map.class.isAssignableFrom(entityClass);
final boolean isListEntity = !isMapEntity && List.class.isAssignableFrom(entityClass);
final MethodSynthesizer entitySynthesizer;
final PropertyDescriptor entityFieldDesc;
if (isMapEntity || isListEntity) {
if (isMapEntity) {
entitySynthesizer = mapSynthesizer;
} else {
entitySynthesizer = listSynthesizer;
}
entityFieldDesc = dtoFieldDesc;
} 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 CollectionPipe(context,
dtoFieldRead, dtoFieldWrite,
entityFieldRead, entityFieldWrite,
meta);