Android
java.lang.reflect
public interface

java.lang.reflect.AnnotatedElement

java.lang.reflect.AnnotatedElement

An interface implemented an annotated element to enable reflective access to annotation information.

Known Indirect Subclasses

Summary

Public Methods

        <T extends Annotation getAnnotation(Class<T> annotationType)
Gets the Annotation for this element for the annotation type passed, if it exists.
          Annotation[]  getAnnotations()
Gets all Annotations for this element.
          Annotation[]  getDeclaredAnnotations()
Gets all Annotations that are explicitly declared by this element (not inherited).
          boolean  isAnnotationPresent(Class<? extends Annotation> annotationType)
Determines if this element has an annotation for the annotation type passed.

Details

Public Methods

public T getAnnotation(Class<T> annotationType)

Gets the Annotation for this element for the annotation type passed, if it exists.

Parameters

annotationType The Class instance of the annotation to search for.

Returns

Throws

NullPointerException if annotationType is null.

public Annotation[] getAnnotations()

Gets all Annotations for this element.

Returns

  • An array of Annotations, which may be empty, but never null.

public Annotation[] getDeclaredAnnotations()

Gets all Annotations that are explicitly declared by this element (not inherited).

Returns

  • An array of Annotations, which may be empty, but never null.

public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Determines if this element has an annotation for the annotation type passed.

Parameters

annotationType The class instance of the annotation to search for.

Returns

  • true if the annotation exists, otherwise false.

Throws

NullPointerException if annotationType is null.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48