Android Guides | Samples

Java.Lang.Reflect.AccessibleObject Class

AccessibleObject is the superclass of all member reflection classes (Field, Constructor, Method).

See Also: AccessibleObject

Syntax

[Android.Runtime.Register("java/lang/reflect/AccessibleObject", DoNotGenerateAcw=true)]
public class AccessibleObject : Object, IAnnotatedElement, IDisposable

Remarks

AccessibleObject is the superclass of all member reflection classes (Field, Constructor, Method). AccessibleObject provides the ability to toggle a flag controlling access checks for these objects. By default, accessing a member (for example, setting a field or invoking a method) checks the validity of the access (for example, invoking a private method from outside the defining class is prohibited) and throws IllegalAccessException if the operation is not permitted. If the accessible flag is set to true, these checks are omitted. This allows privileged code, such as Java object serialization, object inspectors, and debuggers to have complete access to objects.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang.Reflect
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.Reflect.AccessibleObject are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

AccessibleBoolean. Returns true if this object is accessible without access checks.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

GetAnnotation(Class) : Object
GetAnnotations() : IAnnotation[]
Returns, for this element, an array containing all annotations (including inherited annotations).
GetDeclaredAnnotations() : IAnnotation[]
Returns, for this element, all annotations that are explicitly declared (not inherited).
IsAnnotationPresent(Class) : Boolean
static
SetAccessible(AccessibleObject[], Boolean)
Attempts to set the accessible flag for all objects in objects.