Java Code Examples for org.springframework.core.ExceptionDepthComparator#findClosestMatch()
The following examples show how to use
org.springframework.core.ExceptionDepthComparator#findClosestMatch() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnnotationMethodHandlerExceptionResolver.java From lams with GNU General Public License v2.0 | 5 votes |
/** * Uses the {@link ExceptionDepthComparator} to find the best matching method. * @return the best matching method, or {@code null} if none found */ private Method getBestMatchingMethod( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { if (resolverMethods.isEmpty()) { return null; } Class<? extends Throwable> closestMatch = ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); Method method = resolverMethods.get(closestMatch); return ((method == null) || (NO_METHOD_FOUND == method)) ? null : method; }
Example 2
Source File: AnnotationMethodHandlerExceptionResolver.java From spring4-understanding with Apache License 2.0 | 5 votes |
/** * Uses the {@link ExceptionDepthComparator} to find the best matching method. * @return the best matching method, or {@code null} if none found */ private Method getBestMatchingMethod( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { if (resolverMethods.isEmpty()) { return null; } Class<? extends Throwable> closestMatch = ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); Method method = resolverMethods.get(closestMatch); return (method == null || NO_METHOD_FOUND == method ? null : method); }
Example 3
Source File: AnnotationMethodHandlerExceptionResolver.java From spring4-understanding with Apache License 2.0 | 5 votes |
/** * Uses the {@link ExceptionDepthComparator} to find the best matching method. * @return the best matching method, or {@code null} if none found */ private Method getBestMatchingMethod( Map<Class<? extends Throwable>, Method> resolverMethods, Exception thrownException) { if (resolverMethods.isEmpty()) { return null; } Class<? extends Throwable> closestMatch = ExceptionDepthComparator.findClosestMatch(resolverMethods.keySet(), thrownException); Method method = resolverMethods.get(closestMatch); return ((method == null) || (NO_METHOD_FOUND == method)) ? null : method; }