|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejava.lang.reflectas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
The AccessibleObject class is the base class for Field Method and Constructor objects. It provides the ability to flag a reflected object as suppressing default Java language access control checks when it is used. The access checks--for public default (package) access protected and private members--are performed when Fields Methods or Constructors are used to set or get fields to invoke methods or to create and initialize new instances of classes respectively.Class AccessibleObject, void setAccessible(AccessibleObject[], boolean)Setting the accessible flag in a reflected object permits sophisticated applications with sufficient privilege such as Java Object Serialization or other persistence mechanisms to manipulate objects in a manner that would normally be prohibited. @see Field @see Method @see Constructor @see ReflectPermission @since
JDK11.2
Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).Class AccessibleObject, void setAccessible(boolean)First if there is a security manager its
checkPermissionmethod is called with aReflectPermission("suppressAccessChecks")permission.A
SecurityExceptionis raised ifflagistruebut accessibility of any of the elements of the inputarraymay not be changed (for example if the element object is a Constructor object for the class I the event of such a SecurityException the accessiblity of objects is set toflagfor array elements upto (and excluding) the element for which the exception occurred; the accessiblity of elements beyond (and including) the element for which the exception occurred is unchanged. @param array the array of AccessibleObjects @param flag the new value for the accessible flag in each object @throws SecurityException if the request is denied. @see SecurityManager#checkPermission @see java.lang.RuntimePermission
Set the accessible flag for this object to the indicated boolean value. A value of true indicates that the reflected object should suppress Java language access checking when it is used. A value of false indicates that the reflected object should enforce Java language access checks.First if there is a security manager its
checkPermissionmethod is called with aReflectPermission("suppressAccessChecks")permission.A
SecurityExceptionis raised ifflagistruebut accessibility of this object may not be changed (for example if this element object is a Constructor object for the classSecurityExceptionis raised if this object is a java.lang.reflect.Constructor object for the classjava.lang.Classandflagis true. @param flag the new value for the accessible flag @throws SecurityException if the request is denied. @see SecurityManager#checkPermission @see java.lang.RuntimePermission
Creates a new array with the specified component type and length. Invoking this method is equivalent to creating an array as follows:@param componentType theint[] x = {length]}; Array.newInstance[(componentType x]);Classobject representing the component type of the new array @param length the length of the new array @return the new array @exception NullPointerException if the specifiedcomponentTypeparameter is null @exception NegativeArraySizeException if the specifiedlengthis negative
Constructorprovides information about and access to a single constructor for a class.
Constructorpermits widening conversions to occur when matching the actual parameters to newInstance() with the underlying constructor's formal parameters but throws anIllegalArgumentExceptionif a narrowing conversion would occur. @see Member @see java.lang.Class @see java.lang.Class#getConstructors() @see java.lang.Class#getConstructor(Class[]) @see java.lang.Class#getDeclaredConstructors() @author Nakul Saraiya
AFieldprovides information about and dynamic access to a single field of a class or an interface. The reflected field may be a class (static) field or an instance field.A
Fieldpermits widening conversions to occur during a get or set access operation but throws anIllegalArgumentExceptionif a narrowing conversion would occur. @see Member @see java.lang.Class @see java.lang.Class#getFields() @see java.lang.Class#getField(String) @see java.lang.Class#getDeclaredFields() @see java.lang.Class#getDeclaredField(String) @author Nakul Saraiya
Return true if the specifier integer includes theClass Modifier, int STRICTstrictstrictfp modifier.
Theintvalue representing themodifier.strictstrictfp
The Permission class for reflective operations. A ReflectPermission is a named permission and has no actions. The only name currently defined is suppressAccessChecks which allows suppressing the standard Java language access checks -- for public default (package) access protected and private members -- performed by reflected objects at their point of use.The following table provides a summary description of what the permission allows and discusses the risks of granting code the permission.
@see java.security.Permission @see java.security.BasicPermission @see AccessibleObject @see Field#get @see Field#set @see Method#invoke @see Constructor#newInstance @since
Permission Target Name What the Permission Allows Risks of Allowing this Permission suppressAccessChecks ability to access fields and invoke methods in a class. Note that this includes not only public but protected and private fields and methods as well. This is dangerous in that information (possibly confidential) and methods normally unavailable would be accessible to malicious code. JDK11.2