public final class IllegalThrowsCheck extends AbstractCheck
Throwing java.lang.Error or java.lang.RuntimeException is almost never acceptable.
Check has following properties:illegalClassNames - throw class names to reject.
ignoredMethodNames - names of methods to ignore.
ignoreOverriddenMethods - ignore checking overridden methods (marked with Override or java.lang.Override annotation) default value is true.
AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description | 
|---|---|
static String | 
MSG_KEY
A key is pointing to the warning message text in "messages.properties"
 file. 
 | 
| Constructor and Description | 
|---|
IllegalThrowsCheck()  | 
| Modifier and Type | Method and Description | 
|---|---|
int[] | 
getAcceptableTokens()
The configurable token set. 
 | 
int[] | 
getDefaultTokens()
Returns the default token a check is interested in. 
 | 
int[] | 
getRequiredTokens()
The tokens that this check must be registered for. 
 | 
void | 
setIgnoredMethodNames(String... methodNames)
Set the list of ignore method names. 
 | 
void | 
setIgnoreOverriddenMethods(boolean ignoreOverriddenMethods)
Sets ignoreOverriddenMethods property value. 
 | 
void | 
setIllegalClassNames(String... classNames)
Set the list of illegal classes. 
 | 
void | 
visitToken(DetailAST detailAST)
Called to process a token. 
 | 
beginTree, clearMessages, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setClassLoader, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityconfigure, contextualize, getConfiguration, setupChildpublic static final String MSG_KEY
public IllegalThrowsCheck()
public void setIllegalClassNames(String... classNames)
classNames - array of illegal exception classespublic int[] getDefaultTokens()
AbstractCheckgetDefaultTokens in class AbstractCheckTokenTypespublic int[] getRequiredTokens()
AbstractCheckgetRequiredTokens in class AbstractCheckTokenTypespublic int[] getAcceptableTokens()
AbstractCheckgetAcceptableTokens in class AbstractCheckTokenTypespublic void visitToken(DetailAST detailAST)
AbstractCheckvisitToken in class AbstractCheckdetailAST - the token to processpublic void setIgnoredMethodNames(String... methodNames)
methodNames - array of ignored method namespublic void setIgnoreOverriddenMethods(boolean ignoreOverriddenMethods)
ignoreOverriddenMethods - Check's property.Copyright © 2001–2018. All rights reserved.