public class RedundantThrowsCheck extends AbstractTypeAwareCheck
An example of how to configure the check is:
<module name="RedundantThrows"> <property name="allowUnchecked" value="true"/> <property name="allowSubclasses" value="true"/> </module>
AbstractTypeAwareCheck.ClassInfo, AbstractTypeAwareCheck.Token
Constructor and Description |
---|
RedundantThrowsCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
protected void |
logLoadError(AbstractTypeAwareCheck.Token aIdent)
Logs error if unable to load class information.
|
protected void |
processAST(DetailAST aAST)
Called to process an AST when visiting it.
|
void |
setAllowSubclasses(boolean aAllowSubclasses)
Getter for allowSubclasses property.
|
void |
setAllowUnchecked(boolean aAllowUnchecked)
Getter for allowUnchecked property.
|
beginTree, createClassInfo, findClassAlias, getCurrentClassName, getRequiredTokens, isSubclass, isUnchecked, leaveAST, leaveToken, logLoadErrorImpl, resolveClass, setLogLoadErrors, setSuppressLoadErrors, tryLoadClass, visitToken
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getTabWidth, getTokenNames, init, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public void setAllowUnchecked(boolean aAllowUnchecked)
aAllowUnchecked
- whether unchecked excpetions in throws
are allowed or notpublic void setAllowSubclasses(boolean aAllowSubclasses)
aAllowSubclasses
- whether subclass of another declared
exception is allowed in throws clausepublic int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
protected final void processAST(DetailAST aAST)
AbstractTypeAwareCheck
processAST
in class AbstractTypeAwareCheck
aAST
- the AST to process. Guaranteed to not be PACKAGE_DEF or
IMPORT tokens.protected final void logLoadError(AbstractTypeAwareCheck.Token aIdent)
AbstractTypeAwareCheck
logLoadError
in class AbstractTypeAwareCheck
aIdent
- class name for which we can no load class.Copyright © 2001-2014. All Rights Reserved.