public interface AnnotatedConstruct
javax.lang.model.AnnotatedConstruct
in JDK 8.
This interface's sole purpose is to ensure source compatibility with Java 7 and 8, despite the fact that
javax.lang.model.AnnotatedConstruct
was retrofitted into the Java language model hierarchy in JDK 8. See the
JDK 8 JavaDoc for
javax.lang.model.AnnotatedConstruct
for more information.
Implementations may implement both javax.lang.model.AnnotatedConstruct
and this interface. At some time
in the future, when Java 7 compatibility is no longer required, this interface will be deprecated and eventually
removed in favor of javax.lang.model.AnnotatedConstruct
.
Modifier and Type | Method and Description |
---|---|
<A extends Annotation> |
getAnnotation(Class<A> annotationType)
Returns this construct's annotation of the specified type if such an annotation is present, else
null . |
List<? extends AnnotationMirror> |
getAnnotationMirrors()
Returns the annotations that are directly present on this construct.
|
<A extends Annotation> |
getAnnotationsByType(Class<A> annotationType)
Returns annotations that are associated with this construct.
|
List<? extends AnnotationMirror> getAnnotationMirrors()
@Nullable <A extends Annotation> A getAnnotation(Class<A> annotationType)
null
.A
- the annotation typeannotationType
- the Class
object corresponding to the annotation typenull
<A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType)
A
- the annotation typeannotationType
- the Class
object corresponding to the annotation typeCopyright © 2014–2015. All rights reserved.