if ( propertyEntries.isEmpty() ) {
return sourceParam.getName();
}
// simple property
else if ( propertyEntries.size() == 1 ) {
PropertyEntry propertyEntry = propertyEntries.get( 0 );
return sourceParam.getName() + "." + propertyEntry.getAccessor().getSimpleName() + "()";
}
// nested property given as dot path
else {
PropertyEntry lastPropertyEntry = propertyEntries.get( propertyEntries.size() - 1 );
// forge a method from the parameter type to the last entry type.
String forgedMethodName = Strings.joinAndCamelize( sourceReference.getElementNames() );
ForgedMethod methodToGenerate = new ForgedMethod(
forgedMethodName,
sourceReference.getParameter().getType(),
lastPropertyEntry.getType(),
method.getExecutable()
);
NestedPropertyMappingMethod.Builder builder = new NestedPropertyMappingMethod.Builder();
NestedPropertyMappingMethod nestedPropertyMapping = builder
.method( methodToGenerate )