/** * Load the class this field is associated with, and get the {@link Field} reference for this field. * * @return The {@link Field} reference for this field. * @throws IllegalArgumentException * if the field does not exist. */ public Field loadClassAndGetField() throws IllegalArgumentException { try { return loadClass().getField(getName()); } catch (final NoSuchFieldException e1) { try { return loadClass().getDeclaredField(getName()); } catch (final NoSuchFieldException e2) { throw new IllegalArgumentException("No such field: " + getClassName() + "." + getName()); } } }