code: public static Object getFieldVal(final Object obj, final String fieldName, final boolean throwException)
              throws IllegalArgumentException {
          if (obj == null || fieldName == null) {
              if (throwException) {
                  throw new NullPointerException();
              } else {
                  return null;
              }
          }
          return getFieldVal(obj.getClass(), obj, fieldName, throwException);
      }
docs: Get the value of the named field in the class of the given object or any of its superclasses. If an exception
  is thrown while trying to read the field, and throwException is true, then IllegalArgumentException is thrown
  wrapping the cause, otherwise this will return null. If passed a null object, returns null unless
  throwException is true, then throws IllegalArgumentException.
  
  @param obj
  The object.
  @param fieldName
  The field name.
  @param throwException
  If true, throw an exception if the field value could not be read.
  @return The field value.
  @throws IllegalArgumentException
  If the field value could not be read.