private void setObjectToTargetField ( String fieldname , Object value ) throws Exception { Object toWrite = null ; if ( fieldname . contains ( "." ) ) { String path = StringUtils . substringBeforeLast ( fieldname , "." ) ; toWrite = getObjectValue ( path , false ) ; } if ( toWrite == null && isTemporaryField ( fieldname ) ) { String mapKey = StringUtils . substringAfter ( fieldname , "#" ) ; mapKey = StringUtils . substringBefore ( mapKey , "." ) ; temporaryFields . put ( mapKey , value ) ; return ; } String realFieldName = fieldname . contains ( "." ) ? StringUtils . substringAfterLast ( fieldname , "." ) : fieldname ; writeObjectToField ( realFieldName , value , toWrite , target ) ; }
Sets the given value object to the field with the field name of the target object . Is also aware of temporary fields .