private void handleSetProperties ( Object obj , Class < ? > clazz , Entity entity , List < ReflectedInfo > fieldInfo ) throws Siren4JConversionException { if ( ! MapUtils . isEmpty ( entity . getProperties ( ) ) ) { for ( String key : entity . getProperties ( ) . keySet ( ) ) { if ( key . startsWith ( Siren4J . CLASS_RESERVED_PROPERTY ) ) { continue ; } ReflectedInfo info = ReflectionUtils . getFieldInfoByEffectiveName ( fieldInfo , key ) ; if ( info == null ) { info = ReflectionUtils . getFieldInfoByName ( fieldInfo , key ) ; } if ( info != null ) { Object val = entity . getProperties ( ) . get ( key ) ; try { ReflectionUtils . setFieldValue ( obj , info , val ) ; } catch ( Siren4JException e ) { throw new Siren4JConversionException ( e ) ; } } else if ( isErrorOnMissingProperty ( ) && ! ( obj instanceof Collection && key . equals ( "size" ) ) ) { //Houston we have a problem!! throw new Siren4JConversionException ( "Unable to find field: " + key + " for class: " + clazz . getName ( ) ) ; } } } }
Sets field value for an entity s property field .