private void setField ( Field field , Object instance , Object value ) throws SlickXMLException { try { field . setAccessible ( true ) ; field . set ( instance , value ) ; } catch ( IllegalArgumentException e ) { throw new SlickXMLException ( "Failed to set: " + field + " for an XML attribute, is it valid?" , e ) ; } catch ( IllegalAccessException e ) { throw new SlickXMLException ( "Failed to set: " + field + " for an XML attribute, is it valid?" , e ) ; } finally { field . setAccessible ( false ) ; } }
Set a field value on a object instance