Share via


AccessibleObject.SetAccessible(AccessibleObject[], Boolean) Method

Definition

Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).

[Android.Runtime.Register("setAccessible", "([Ljava/lang/reflect/AccessibleObject;Z)V", "")]
public static void SetAccessible (Java.Lang.Reflect.AccessibleObject[]? array, bool flag);
[<Android.Runtime.Register("setAccessible", "([Ljava/lang/reflect/AccessibleObject;Z)V", "")>]
static member SetAccessible : Java.Lang.Reflect.AccessibleObject[] * bool -> unit

Parameters

array
AccessibleObject[]

the array of AccessibleObjects

flag
Boolean

the new value for the accessible flag in each object

Attributes

Remarks

Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).

First, if there is a security manager, its checkPermission method is called with a ReflectPermission("suppressAccessChecks") permission.

A SecurityException is raised if flag is true but accessibility of any of the elements of the input array may not be changed (for example, if the element object is a Constructor object for the class java.lang.Class). In the event of such a SecurityException, the accessibility of objects is set to flag for array elements upto (and excluding) the element for which the exception occurred; the accessibility of elements beyond (and including) the element for which the exception occurred is unchanged.

Java documentation for java.lang.reflect.AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to