Class AbstractFailureAnalyzer<T extends Throwable>
- java.lang.Object
- org.springframework.boot.diagnostics.AbstractFailureAnalyzer<T>
- Type Parameters:
T
- the type of exception to analyze
- All Implemented Interfaces:
FailureAnalyzer
- Direct Known Subclasses:
AbstractInjectionFailureAnalyzer
,BeanNotOfRequiredTypeFailureAnalyzer
public abstract class AbstractFailureAnalyzer<T extends Throwable> extends Object implements FailureAnalyzer
Abstract base class for mostFailureAnalyzer
implementations.- Since:
- 1.4.0
Constructor Summary
Constructors Constructor Description AbstractFailureAnalyzer()
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FailureAnalysis
analyze(Throwable failure)
Returns an analysis of the givenfailure
, ornull
if no analysis was possible.protected abstract FailureAnalysis
analyze(Throwable rootFailure, T cause)
Returns an analysis of the givenrootFailure
, ornull
if no analysis was possible.protected <E extends Throwable>
EfindCause(Throwable failure, Class<E> type)
protected Class<? extends T>
getCauseType()
Return the cause type being handled by the analyzer.
Constructor Detail
AbstractFailureAnalyzer
public AbstractFailureAnalyzer()
Method Detail
analyze
public FailureAnalysis analyze(Throwable failure)
Description copied from interface:FailureAnalyzer
Returns an analysis of the givenfailure
, ornull
if no analysis was possible.- Specified by:
analyze
in interfaceFailureAnalyzer
- Parameters:
failure
- the failure- Returns:
- the analysis or
null
analyze
protected abstract FailureAnalysis analyze(Throwable rootFailure, T cause)
Returns an analysis of the givenrootFailure
, ornull
if no analysis was possible.- Parameters:
rootFailure
- the root failure passed to the analyzercause
- the actual found cause- Returns:
- the analysis or
null
getCauseType
protected Class<? extends T> getCauseType()
Return the cause type being handled by the analyzer. By default the class generic is used.- Returns:
- the cause type