public final class IllegalTypeCheck extends AbstractFormatCheck
Checks that particular class are never used as types in variable declarations, return values or parameters. Includes a pattern check that by default disallows abstract classes.
Rationale: Helps reduce coupling on concrete classes. In addition abstract classes should be thought of a convenience base class implementations of interfaces and as such are not types themsleves.
| Constructor and Description |
|---|
IllegalTypeCheck()
Creates new instance of the check.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
String[] |
getIgnoredMethodNames()
Get the list of ignored method names.
|
String[] |
getIllegalClassNames()
Get the list of illegal variable types.
|
String[] |
getLegalAbstractClassNames()
Get the list of legal abstract class names.
|
void |
setIgnoredMethodNames(String[] aMethodNames)
Set the list of ignore method names.
|
void |
setIllegalClassNames(String[] aClassNames)
Set the list of illegal variable types.
|
void |
setLegalAbstractClassNames(String[] aClassNames)
Set the list of legal abstract class names.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
getFormat, getRegexp, setCompileFlags, setFormatbeginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic void visitToken(DetailAST aAST)
CheckvisitToken in class CheckaAST - the token to processpublic void setIllegalClassNames(String[] aClassNames)
aClassNames - array of illegal variable typespublic String[] getIllegalClassNames()
public void setIgnoredMethodNames(String[] aMethodNames)
aMethodNames - array of ignored method namespublic String[] getIgnoredMethodNames()
public void setLegalAbstractClassNames(String[] aClassNames)
aClassNames - array of legal abstract class namespublic String[] getLegalAbstractClassNames()
Copyright © 2001-2012. All Rights Reserved.