com.puppycrawl.tools.checkstyle.checks.coding

Class IllegalCatchCheck

Implemented Interfaces:
Configurable, Contextualizable

public final class IllegalCatchCheck
extends Check

Catching java.lang.Exception, java.lang.Error or java.lang.RuntimeException is almost never acceptable.

Author:
Simon Harris TODO: Merge some code and make a base class with IllegalThrowsCheck

Constructor Summary

IllegalCatchCheck()
Creates new instance of the check.

Method Summary

int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
setIllegalClassNames(String[] aClassNames)
Set the list of illegal exception classes.
void
visitToken(DetailAST aDetailAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

IllegalCatchCheck

public IllegalCatchCheck()
Creates new instance of the check.

Method Details

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

See Also:
Check


getRequiredTokens

public int[] getRequiredTokens()
Overrides:
getRequiredTokens in interface Check

See Also:
Check


setIllegalClassNames

public void setIllegalClassNames(String[] aClassNames)
Set the list of illegal exception classes.

Parameters:
aClassNames - array of illegal exception classes


visitToken

public void visitToken(DetailAST aDetailAST)
Overrides:
visitToken in interface Check

See Also:
Check