public static Object readDeclaredField(final Object target,final String fieldName,final boolean forceAccess) throws IllegalAccessException {
  if (target == null) {
    throw new IllegalArgumentException("target object must not be null");
  }
  Class<?> cls=target.getClass();
  Field field=FieldUtils.getDeclaredField(cls,fieldName,forceAccess);
  if (field == null) {
    throw new IllegalArgumentException("Cannot locate declared field " + cls.getName() + "."+ fieldName);
  }
  return FieldUtils.readField(field,target);
}

public static Object readDeclaredField ( final Object target , final String fieldName , final boolean forceAccess ) throws IllegalAccessException { if ( target == null ) { throw new IllegalArgumentException ( "target object must not be null" ) ; } Class < ? > cls = target . getClass ( ) ; Field field = FieldUtils . getDeclaredField ( cls , fieldName , forceAccess ) ; if ( field == null ) { throw new IllegalArgumentException ( "Cannot locate declared field " + cls . getName ( ) + "." + fieldName ) ; } return FieldUtils . readField ( field , target ) ; }
< p < > gets a field value by name . only the class of the specified object will be considered .
