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

public static void writeField ( final Object target , final String fieldName , final Object value , final boolean forceAccess ) throws IllegalAccessException { if ( target == null ) { throw new IllegalArgumentException ( "target object must not be null" ) ; } Class < ? > cls = target . getClass ( ) ; Field field = FieldUtils . getField ( cls , fieldName , forceAccess ) ; if ( field == null ) { throw new IllegalArgumentException ( "Cannot locate declared field " + cls . getName ( ) + "." + fieldName ) ; } FieldUtils . writeField ( field , target , value ) ; }
write a field . superclasses will be considered .
