public class AlphabeticallyOrderedDefinitionsCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
The configuration checks the ordering of variable and method definitions under classes and interfaces.
<module name="AlphabeticallyOrderedDefinitions"/>This check will error on a definition's line if it should be alphabetically before the last definition that has the same modifiers.
To specify non-access modifiers to ignore, you can configure the ignoredModifiers property with
final, static,
transient, native,
synchronized, and volatile.
For example, the following configuration will check that definitions that have the same modifiers, but ignoring whether they have static or final modifiers in common, are alphabetically ordered.
<module name="AlphabeticallyOrderedDefinitions">
<property name="ignoredModifiers" value="static, final"/>
</module>
| Constructor and Description |
|---|
AlphabeticallyOrderedDefinitionsCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens() |
int[] |
getDefaultTokens() |
int[] |
getRequiredTokens() |
void |
setIgnoredModifiers(String[] modifiers) |
void |
visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) |
beginTree, clearViolations, destroy, finishTree, getFileContents, getLine, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeveritypublic AlphabeticallyOrderedDefinitionsCheck()
public int[] getDefaultTokens()
getDefaultTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getAcceptableTokens()
getAcceptableTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getRequiredTokens()
getRequiredTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic void setIgnoredModifiers(String[] modifiers)
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast)
visitToken in class com.puppycrawl.tools.checkstyle.api.AbstractCheckCopyright © 2022 Atlassian. All rights reserved.