< prev index next >

src/java.base/share/classes/java/lang/reflect/AnnotatedType.java

Print this page

        

@@ -23,10 +23,12 @@
  * questions.
  */
 
 package java.lang.reflect;
 
+import java.lang.annotation.Annotation;
+
 /**
  * {@code AnnotatedType} represents the potentially annotated use of a type in
  * the program currently running in this VM. The use may be of any type in the
  * Java programming language, including an array type, a parameterized type, a
  * type variable, or a wildcard type.

@@ -70,6 +72,18 @@
      * Returns the underlying type that this annotated type represents.
      *
      * @return the type this annotated type represents
      */
     public Type getType();
+
+    /**
+     * {@inheritDoc}
+     * <p>Note that any annotation returned by this method is a type
+     * annotation.
+     *
+     * @throws NullPointerException {@inheritDoc}
+     * @since 1.8
+     */
+    @Override
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+
 }
< prev index next >