src/share/classes/java/lang/reflect/Field.java
Print this page
*** 358,369 ****
* to be extracted
* @return the value of the represented field in object
* {@code obj}; primitive values are wrapped in an appropriate
* object before being returned
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof).
* @exception NullPointerException if the specified object is null
* and the field is an instance field.
--- 358,370 ----
* to be extracted
* @return the value of the represented field in object
* {@code obj}; primitive values are wrapped in an appropriate
* object before being returned
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof).
* @exception NullPointerException if the specified object is null
* and the field is an instance field.
*** 381,392 ****
*
* @param obj the object to extract the {@code boolean} value
* from
* @return the value of the {@code boolean} field
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code boolean} by a
--- 382,394 ----
*
* @param obj the object to extract the {@code boolean} value
* from
* @return the value of the {@code boolean} field
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code boolean} by a
*** 408,419 ****
*
* @param obj the object to extract the {@code byte} value
* from
* @return the value of the {@code byte} field
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code byte} by a
--- 410,422 ----
*
* @param obj the object to extract the {@code byte} value
* from
* @return the value of the {@code byte} field
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code byte} by a
*** 437,448 ****
*
* @param obj the object to extract the {@code char} value
* from
* @return the value of the field converted to type {@code char}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code char} by a
--- 440,452 ----
*
* @param obj the object to extract the {@code char} value
* from
* @return the value of the field converted to type {@code char}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code char} by a
*** 466,477 ****
*
* @param obj the object to extract the {@code short} value
* from
* @return the value of the field converted to type {@code short}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code short} by a
--- 470,482 ----
*
* @param obj the object to extract the {@code short} value
* from
* @return the value of the field converted to type {@code short}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code short} by a
*** 495,506 ****
*
* @param obj the object to extract the {@code int} value
* from
* @return the value of the field converted to type {@code int}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code int} by a
--- 500,512 ----
*
* @param obj the object to extract the {@code int} value
* from
* @return the value of the field converted to type {@code int}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code int} by a
*** 524,535 ****
*
* @param obj the object to extract the {@code long} value
* from
* @return the value of the field converted to type {@code long}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code long} by a
--- 530,542 ----
*
* @param obj the object to extract the {@code long} value
* from
* @return the value of the field converted to type {@code long}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code long} by a
*** 553,564 ****
*
* @param obj the object to extract the {@code float} value
* from
* @return the value of the field converted to type {@code float}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code float} by a
--- 560,572 ----
*
* @param obj the object to extract the {@code float} value
* from
* @return the value of the field converted to type {@code float}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code float} by a
*** 582,593 ****
*
* @param obj the object to extract the {@code double} value
* from
* @return the value of the field converted to type {@code double}
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code double} by a
--- 590,602 ----
*
* @param obj the object to extract the {@code double} value
* from
* @return the value of the field converted to type {@code double}
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code double} by a
*** 624,636 ****
* <p>If this {@code Field} object enforces Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
*
* <p>If the underlying field is final, the method throws an
! * {@code IllegalAccessException} unless
! * {@code setAccessible(true)} has succeeded for this field
! * and this field is non-static. Setting a final field in this way
* is meaningful only during deserialization or reconstruction of
* instances of classes with blank final fields, before they are
* made available for access by other parts of a program. Use in
* any other context may have unpredictable effects, including cases
* in which other parts of a program continue to use the original
--- 633,645 ----
* <p>If this {@code Field} object enforces Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
*
* <p>If the underlying field is final, the method throws an
! * {@code IllegalAccessException} unless {@code setAccessible(true)}
! * has succeeded for this {@code Field} object
! * and the field is non-static. Setting a final field in this way
* is meaningful only during deserialization or reconstruction of
* instances of classes with blank final fields, before they are
* made available for access by other parts of a program. Use in
* any other context may have unpredictable effects, including cases
* in which other parts of a program continue to use the original
*** 656,667 ****
*
* @param obj the object whose field should be modified
* @param value the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 665,677 ----
*
* @param obj the object whose field should be modified
* @param value the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 684,695 ****
*
* @param obj the object whose field should be modified
* @param z the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 694,706 ----
*
* @param obj the object whose field should be modified
* @param z the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 713,724 ****
*
* @param obj the object whose field should be modified
* @param b the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 724,736 ----
*
* @param obj the object whose field should be modified
* @param b the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 742,753 ****
*
* @param obj the object whose field should be modified
* @param c the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 754,766 ----
*
* @param obj the object whose field should be modified
* @param c the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 771,782 ****
*
* @param obj the object whose field should be modified
* @param s the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 784,796 ----
*
* @param obj the object whose field should be modified
* @param s the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 800,811 ****
*
* @param obj the object whose field should be modified
* @param i the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 814,826 ----
*
* @param obj the object whose field should be modified
* @param i the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 829,840 ****
*
* @param obj the object whose field should be modified
* @param l the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 844,856 ----
*
* @param obj the object whose field should be modified
* @param l the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 858,869 ****
*
* @param obj the object whose field should be modified
* @param f the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 874,886 ----
*
* @param obj the object whose field should be modified
* @param f the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
*** 887,898 ****
*
* @param obj the object whose field should be modified
* @param d the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if the underlying field
! * is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
--- 904,916 ----
*
* @param obj the object whose field should be modified
* @param d the new value for the field of {@code obj}
* being modified
*
! * @exception IllegalAccessException if this {@code Field} object
! * enforces Java language access control and the underlying
! * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null