24 */ |
24 */ |
25 |
25 |
26 package java.lang.reflect; |
26 package java.lang.reflect; |
27 |
27 |
28 import java.lang.annotation.Annotation; |
28 import java.lang.annotation.Annotation; |
|
29 import java.lang.annotation.AnnotationFormatError; |
29 |
30 |
30 /** |
31 /** |
31 * Represents an annotated element of the program currently running in this |
32 * Represents an annotated element of the program currently running in this |
32 * VM. This interface allows annotations to be read reflectively. All |
33 * VM. This interface allows annotations to be read reflectively. All |
33 * annotations returned by methods in this interface are immutable and |
34 * annotations returned by methods in this interface are immutable and |
84 * a {@link EnumConstantNotPresentException} if the enum constant in the |
85 * a {@link EnumConstantNotPresentException} if the enum constant in the |
85 * annotation is no longer present in the enum type. |
86 * annotation is no longer present in the enum type. |
86 * |
87 * |
87 * <p>Attempting to read annotations of a repeatable annotation type T |
88 * <p>Attempting to read annotations of a repeatable annotation type T |
88 * that are contained in an annotation whose type is not, in fact, the |
89 * that are contained in an annotation whose type is not, in fact, the |
89 * containing annotation type of T will result in an |
90 * containing annotation type of T, will result in an {@link |
90 * InvalidContainerAnnotationError. |
91 * AnnotationFormatError}. |
91 * |
92 * |
92 * <p>Finally, attempting to read a member whose definition has evolved |
93 * <p>Finally, attempting to read a member whose definition has evolved |
93 * incompatibly will result in a {@link |
94 * incompatibly will result in a {@link |
94 * java.lang.annotation.AnnotationTypeMismatchException} or an |
95 * java.lang.annotation.AnnotationTypeMismatchException} or an |
95 * {@link java.lang.annotation.IncompleteAnnotationException}. |
96 * {@link java.lang.annotation.IncompleteAnnotationException}. |
96 * |
97 * |
97 * @see java.lang.EnumConstantNotPresentException |
98 * @see java.lang.EnumConstantNotPresentException |
98 * @see java.lang.TypeNotPresentException |
99 * @see java.lang.TypeNotPresentException |
99 * @see java.lang.annotation.AnnotationFormatError |
100 * @see AnnotationFormatError |
100 * @see java.lang.annotation.AnnotationTypeMismatchException |
101 * @see java.lang.annotation.AnnotationTypeMismatchException |
101 * @see java.lang.annotation.IncompleteAnnotationException |
102 * @see java.lang.annotation.IncompleteAnnotationException |
102 * @see java.lang.annotation.InvalidContainerAnnotationError |
|
103 * @since 1.5 |
103 * @since 1.5 |
104 * @author Josh Bloch |
104 * @author Josh Bloch |
105 */ |
105 */ |
106 public interface AnnotatedElement { |
106 public interface AnnotatedElement { |
107 /** |
107 /** |