Class ExceptionTypeFilter

java.lang.Object
org.springframework.util.InstanceFilter<Class<? extends Throwable>>
org.springframework.util.ExceptionTypeFilter

public class ExceptionTypeFilter extends InstanceFilter<Class<? extends Throwable>>
An InstanceFilter that handles exception types.

An exception type will match against a given candidate if it is assignable to that candidate.

Since:
4.1
Author:
Stephane Nicoll, Sam Brannen
  • Constructor Details

  • Method Details

    • match

      public boolean match(Throwable exception)
      Determine if the type of the supplied exception matches this filter.
      Since:
      7.0
      See Also:
    • match

      protected boolean match(Class<? extends Throwable> instance, Class<? extends Throwable> candidate)
      Determine if the specified instance matches the specified candidate.

      By default, the two instances match if the candidate type is is assignable from the instance type.

      Can be overridden by subclasses.

      Overrides:
      match in class InstanceFilter<Class<? extends Throwable>>
      Parameters:
      instance - the instance to check
      candidate - a candidate defined by this filter
      Returns:
      true if the instance matches the candidate