< prev index next >

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

Print this page

761      * represented by this Executable. The order of the objects in the array
762      * corresponds to the order of the exception types in the declaration of
763      * the method/constructor.
764      *
765      * Returns an array of length 0 if the method/constructor declares no
766      * exceptions.
767      *
768      * @return an array of objects representing the declared
769      * exceptions of the method or constructor represented by this {@code
770      * Executable}
771      */
772     public AnnotatedType[] getAnnotatedExceptionTypes() {
773         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
774                 SharedSecrets.getJavaLangAccess().
775                         getConstantPool(getDeclaringClass()),
776                 this,
777                 getDeclaringClass(),
778                 getGenericExceptionTypes(),
779                 TypeAnnotation.TypeAnnotationTarget.THROWS);
780     }








781 }

761      * represented by this Executable. The order of the objects in the array
762      * corresponds to the order of the exception types in the declaration of
763      * the method/constructor.
764      *
765      * Returns an array of length 0 if the method/constructor declares no
766      * exceptions.
767      *
768      * @return an array of objects representing the declared
769      * exceptions of the method or constructor represented by this {@code
770      * Executable}
771      */
772     public AnnotatedType[] getAnnotatedExceptionTypes() {
773         return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
774                 SharedSecrets.getJavaLangAccess().
775                         getConstantPool(getDeclaringClass()),
776                 this,
777                 getDeclaringClass(),
778                 getGenericExceptionTypes(),
779                 TypeAnnotation.TypeAnnotationTarget.THROWS);
780     }
781 
782     String getDeclaringClassTypeName() {
783         Class<?> c = getDeclaringClass();
784         if (c.isPrimitiveClass()) {
785             c = c.asValueType();
786         }
787         return c.getTypeName();
788     }
789 }
< prev index next >