public static Object getObjectCopy ( Object from , Field field ) { if ( ! field . isAccessible ( ) ) { field . setAccessible ( true ) ; } try { PropertyAccessor < ? > accessor = PropertyAccessorFactory . getPropertyAccessor ( field ) ; return accessor . getCopy ( field . get ( from ) ) ; } catch ( IllegalArgumentException iarg ) { throw new PropertyAccessException ( iarg ) ; } catch ( IllegalAccessException iacc ) { throw new PropertyAccessException ( iacc ) ; } }
Retutrns copy of object