| Package | Description |
|---|---|
| java.lang | |
| java.lang.annotation | |
| java.lang.reflect |
Provides classes and interfaces for obtaining reflective
information about classes and objects.
|
| Modifier and Type | Class and Description |
|---|---|
interface |
Deprecated
A program element annotated @Deprecated is one that programmers
are discouraged from using, typically because it is dangerous,
or because a better alternative exists.
|
interface |
FunctionalInterface
An informative annotation type used to indicate that an interface
type declaration is intended to be a functional interface as
defined by the Java Language Specification.
|
interface |
Override
Indicates that a method declaration is intended to override a
method declaration in a supertype.
|
| Modifier and Type | Method and Description |
|---|---|
<A extends Annotation> |
Class.getAnnotation(Class<A> annotationClass) |
| Modifier and Type | Method and Description |
|---|---|
Annotation[] |
Class.getAnnotations() |
Annotation[] |
Class.getDeclaredAnnotations() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
Class.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
| Modifier and Type | Class and Description |
|---|---|
interface |
Documented
Indicates that annotations with a type are to be documented by javadoc
and similar tools by default.
|
interface |
Retention
Indicates how long annotations with the annotated type are to
be retained.
|
interface |
Target
Indicates the kinds of program element to which an annotation type
is applicable.
|
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Annotation> |
Annotation.annotationType()
Returns the annotation type of this annotation.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Annotation> |
Method.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
Field.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
Constructor.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
AnnotatedElement.getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if
such an annotation is present, else null.
|
<T extends Annotation> |
AccessibleObject.getAnnotation(Class<T> annotationClass) |
default <T extends Annotation> |
AnnotatedElement.getAnnotationsByType(Class<T> annotationClass)
Returns annotations that are associated with this element.
|
default <T extends Annotation> |
AnnotatedElement.getDeclaredAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if
such an annotation is directly present, else null.
|
default <T extends Annotation> |
AnnotatedElement.getDeclaredAnnotationsByType(Class<T> annotationClass)
Returns this element's annotation(s) for the specified type if
such annotations are either directly present or
indirectly present.
|
| Modifier and Type | Method and Description |
|---|---|
Annotation[] |
AnnotatedElement.getAnnotations()
Returns annotations that are present on this element.
|
Annotation[] |
AccessibleObject.getAnnotations() |
default <T extends Annotation> |
AnnotatedElement.getAnnotationsByType(Class<T> annotationClass)
Returns annotations that are associated with this element.
|
Annotation[] |
Method.getDeclaredAnnotations() |
Annotation[] |
Field.getDeclaredAnnotations() |
Annotation[] |
Constructor.getDeclaredAnnotations() |
Annotation[] |
AnnotatedElement.getDeclaredAnnotations()
Returns annotations that are directly present on this element.
|
Annotation[] |
AccessibleObject.getDeclaredAnnotations() |
default <T extends Annotation> |
AnnotatedElement.getDeclaredAnnotationsByType(Class<T> annotationClass)
Returns this element's annotation(s) for the specified type if
such annotations are either directly present or
indirectly present.
|
Annotation[][] |
Method.getParameterAnnotations()
Returns an array of arrays that represent the annotations on the formal
parameters, in declaration order, of the method represented by
this
Method object. |
Annotation[][] |
Constructor.getParameterAnnotations()
Returns an array of arrays that represent the annotations on the formal
parameters, in declaration order, of the method represented by
this
Constructor object. |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
AnnotatedElement.isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns true if an annotation for the specified type
is present on this element, else false.
|
boolean |
AccessibleObject.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
Copyright © 2025 API Design. All Rights Reserved.