/** * Returns an array of {@code AnnotatedType} objects that represent the use * of types to specify the declared exceptions of the method/constructor * represented by this Executable. The order of the objects in the array * corresponds to the order of the exception types in the declaration of * the method/constructor. * * Returns an array of length 0 if the method/constructor declares no * exceptions. * * @return an array of objects representing the declared exceptions of the method or constructor represented by this {@code Executable} */ public AnnotatedType[] getAnnotatedExceptionTypes() { return this.method.getAnnotatedExceptionTypes(); }
private void doResponses(OperationObject operationObject, Function function) throws Exception { doResponse(operationObject, function.method.getAnnotatedReturnType()); for (AnnotatedType annotatedException : function.method .getAnnotatedExceptionTypes()) { doResponse(operationObject, annotatedException, annotatedException); } }
private ImmutableMap<Short, ThriftType> buildExceptionMap(ThriftCatalog catalog, ThriftMethod thriftMethod) stream(method.getAnnotatedExceptionTypes()).anyMatch(type -> type.isAnnotationPresent(ThriftId.class)); checkArgument(!mixedStyle, "ThriftMethod [%s] uses a mix of @ThriftException and @ThriftId", methodName(method)); AnnotatedType[] exceptionAnnotations = method.getAnnotatedExceptionTypes(); for (int i = 0; i < allExceptionClasses.length; i++) { Class<?> exception = allExceptionClasses[i];