Skip to content

Commit

Permalink
Polish Javadoc for base ExceptionHandlerMethodResolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Jan 11, 2021
1 parent 570bdbd commit 2fd6e6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ protected AbstractExceptionHandlerMethodResolver(Map<Class<? extends Throwable>,
}

/**
* Extract the exceptions this method handles.This implementation looks for
* Extract the exceptions this method handles. This implementation looks for
* sub-classes of Throwable in the method signature.
* The method is static to ensure safe use from sub-class constructors.
* <p>The method is static to ensure safe use from sub-class constructors.
*/
@SuppressWarnings("unchecked")
protected static List<Class<? extends Throwable>> getExceptionsFromMethodSignature(Method method) {
Expand All @@ -94,7 +94,7 @@ public boolean hasExceptionMappings() {

/**
* Find a {@link Method} to handle the given exception.
* Use {@link ExceptionDepthComparator} if more than one match is found.
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
*/
Expand All @@ -113,6 +113,7 @@ public Method resolveMethod(Throwable exception) {
/**
* Find a {@link Method} to handle the given exception type. This can be
* useful if an {@link Exception} instance is not available (e.g. for tools).
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exceptionType the exception type
* @return a Method to handle the exception, or {@code null} if none found
* @since 4.3.1
Expand All @@ -128,7 +129,8 @@ public Method resolveMethodByExceptionType(Class<? extends Throwable> exceptionT
}

/**
* Return the {@link Method} mapped to the given exception type, or {@code null} if none.
* Return the {@link Method} mapped to the given exception type, or
* {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
*/
@Nullable
private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
Expand All @@ -150,8 +152,9 @@ private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
}

/**
* For the NO_MATCHING_EXCEPTION_HANDLER_METHOD constant.
* For the {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} constant.
*/
@SuppressWarnings("unused")
private void noMatchingExceptionHandler() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public boolean hasExceptionMappings() {

/**
* Find a {@link Method} to handle the given exception.
* Use {@link ExceptionDepthComparator} if more than one match is found.
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
*/
Expand All @@ -136,7 +136,7 @@ public Method resolveMethod(Exception exception) {

/**
* Find a {@link Method} to handle the given Throwable.
* Use {@link ExceptionDepthComparator} if more than one match is found.
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exception the exception
* @return a Method to handle the exception, or {@code null} if none found
* @since 5.0
Expand All @@ -156,6 +156,7 @@ public Method resolveMethodByThrowable(Throwable exception) {
/**
* Find a {@link Method} to handle the given exception type. This can be
* useful if an {@link Exception} instance is not available (e.g. for tools).
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
* @param exceptionType the exception type
* @return a Method to handle the exception, or {@code null} if none found
*/
Expand All @@ -170,7 +171,8 @@ public Method resolveMethodByExceptionType(Class<? extends Throwable> exceptionT
}

/**
* Return the {@link Method} mapped to the given exception type, or {@code null} if none.
* Return the {@link Method} mapped to the given exception type, or
* {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} if none.
*/
private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
List<Class<? extends Throwable>> matches = new ArrayList<>();
Expand All @@ -191,8 +193,9 @@ private Method getMappedMethod(Class<? extends Throwable> exceptionType) {
}

/**
* For the NO_MATCHING_EXCEPTION_HANDLER_METHOD constant.
* For the {@link #NO_MATCHING_EXCEPTION_HANDLER_METHOD} constant.
*/
@SuppressWarnings("unused")
private void noMatchingExceptionHandler() {
}

Expand Down

0 comments on commit 2fd6e6e

Please sign in to comment.