public final class IllegalThrowsCheck extends AbstractIllegalCheck
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.
ignoreOverridenMethods - ignore checking overriden methods (marked with Override or java.lang.Override annotation) default value is true.
| Constructor and Description |
|---|
IllegalThrowsCheck()
Creates new instance of the check.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
setIgnoreOverridenMethods(boolean ignoreOverridenMethods)
Sets ignoreOverridenMethods property value.
|
void |
visitToken(DetailAST detailAST)
Called to process a token.
|
isIllegalClassName, setIllegalClassNamesbeginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic IllegalThrowsCheck()
public int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic void visitToken(DetailAST detailAST)
CheckvisitToken in class CheckdetailAST - the token to processpublic void setIgnoredMethodNames(String[] methodNames)
methodNames - array of ignored method namespublic void setIgnoreOverridenMethods(boolean ignoreOverridenMethods)
ignoreOverridenMethods - Check's property.Copyright © 2001–2015. All rights reserved.