public class ParameterNumberCheck extends Check
Checks the number of parameters that a method or constructor has. The default allowable number of parameters is 7. To change the number of allowable parameters, set property max.
An example of how to configure the check is:
<module name="ParameterNumber"/>
An example of how to configure the check to allow 10 parameters is:
<module name="ParameterNumber"> <property name="max" value="10"/> </module>
Constructor and Description |
---|
ParameterNumberCheck() |
Modifier and Type | Method and Description |
---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
void |
setMax(int aMax)
Sets the maximum number of allowed parameters.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens
getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public void setMax(int aMax)
aMax
- the max allowed parameterspublic int[] getDefaultTokens()
getDefaultTokens
in class Check
TokenTypes
public void visitToken(DetailAST aAST)
visitToken
in class Check
aAST
- the token to process