public static void set ( Object target , Field field , Object value ) { if ( target != null ) { if ( ! field . isAccessible ( ) ) { field . setAccessible ( true ) ; } try { field . set ( target , value ) ; } catch ( IllegalArgumentException iarg ) { throw new PropertyAccessException ( iarg ) ; } catch ( IllegalAccessException iacc ) { throw new PropertyAccessException ( iacc ) ; } } // ignore if object is null; }
Sets an object onto a field .