com.puppycrawl.tools.checkstyle.checks.whitespace
Class TabCharacterCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.Check
com.puppycrawl.tools.checkstyle.checks.whitespace.TabCharacterCheck
- All Implemented Interfaces:
- Configurable, Contextualizable
- public class TabCharacterCheck
- extends Check
Reports tab characters ('\t') in the source code.
Rationale:
- Developers should not need to configure the tab width of their
text editors in order to be able to read source code.
- From the Apache jakarta coding standards:
In a distributed development environment, when the
cvs commit messages get sent to a mailing list, they are almost
impossible to read if you use tabs.
An example of how to configure the check is:
<module name="TabCharacter"/>
- Author:
- Lars Kühne
Method Summary |
void |
beginTree(DetailAST aRootAST)
Called before the starting to process a tree. Ideal place to initialise
information that is to be collected whilst processing a tree. |
int[] |
getDefaultTokens()
Returns the default token a check is interested in. Only used if the
configuration for a check does not define the tokens. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TabCharacterCheck
public TabCharacterCheck()
getDefaultTokens
public int[] getDefaultTokens()
- Returns the default token a check is interested in. Only used if the
configuration for a check does not define the tokens.
- Specified by:
getDefaultTokens
in class Check
- Returns:
- the default tokens
- See Also:
TokenTypes
beginTree
public void beginTree(DetailAST aRootAST)
- Called before the starting to process a tree. Ideal place to initialise
information that is to be collected whilst processing a tree.
- Overrides:
beginTree
in class Check
- Parameters:
aRootAST
- the root of the tree