AccessibleObject

public class AccessibleObject extends Object
implements AnnotatedElement
Known Direct Subclasses
Known Indirect Subclasses

Stub implementation of AccessibleObject. The actual implementation is in AccessibleObject.h and AccessibleObject.m, so the declared methods in this class should match the actual methods implemented in order to catch unsupported API references.

See Also

Public Constructor Summary

Public Method Summary

<T extends Annotation> T
getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if such an annotation is present, else null.
Annotation[]
getAnnotations()
Returns annotations that are present on this element.
Annotation[]
getDeclaredAnnotations()
Returns annotations that are directly present on this element.
boolean
boolean
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns true if an annotation for the specified type is present on this element, else false.
void
setAccessible(boolean b)
static void
setAccessible(AccessibleObject[] objects, boolean b)

Inherited Method Summary

Public Constructors

public AccessibleObject ()

Public Methods

public T getAnnotation (Class<T> annotationClass)

Returns this element's annotation for the specified type if such an annotation is present, else null.

Parameters
annotationClass the Class object corresponding to the annotation type
Returns
  • this element's annotation for the specified annotation type if present on this element, else null

public Annotation[] getAnnotations ()

Returns annotations that are present on this element. If there are no annotations present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.

Returns
  • annotations present on this element

public Annotation[] getDeclaredAnnotations ()

Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length