Returns this element's annotation for the specified type if such an annotation is present, else null.
annotationClass | the Class object corresponding to the annotation type |
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 that are associated with this element.
If there are no annotations associated with this element, the return
value is an array of length 0.
The difference between this method and getAnnotation(Class)
is that this method detects if its argument is a repeatable
annotation type (JLS 9.6), and if so, attempts to find one or
more annotations of that type by "looking through" a container
annotation.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.
annotationClass | the Class object corresponding to the annotation type |
Returns this element's annotation for the specified type if such an annotation is directly present, else null. This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.)
annotationClass | the Class object corresponding to the annotation type |
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 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 this element's annotation(s) for the specified type if
such annotations are either directly present or
indirectly present. This method ignores inherited
annotations.
If there are no specified annotations directly or indirectly
present on this element, the return value is an array of length
0.
The difference between this method and getDeclaredAnnotation(Class)
is that this method detects if its
argument is a repeatable annotation type (JLS 9.6), and if so,
attempts to find one or more annotations of that type by "looking
through" a container annotation if one is present.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.
annotationClass | the Class object corresponding to the annotation type |
Return an informative string for the name of this type.
Returns an array of TypeVariable
objects that represent the
type variables declared by the generic declaration represented by this
GenericDeclaration
object, in declaration order. Returns an
array of length 0 if the underlying generic declaration declares no type
variables.
TypeVariable
objects that represent
the type variables declared by this generic declaration
Returns true if an annotation for the specified type is present on this element, else false. This method is designed primarily for convenient access to marker annotations.
The truth value returned by this method is equivalent to:
getAnnotation(annotationClass) != null
The body of the default method is specified to be the code above.
annotationClass | the Class object corresponding to the annotation type |
Diagram: Class, Package, Module