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, setFormat
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public void visitToken(DetailAST aAST)
Check
visitToken
in class Check
aAST
- 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–2013. All rights reserved.