Package com.qulice.checkstyle
Class CurlyBracketsStructureCheck
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- com.qulice.checkstyle.CurlyBracketsStructureCheck
-
- All Implemented Interfaces:
Configurable
,Contextualizable
public final class CurlyBracketsStructureCheck extends AbstractCheck
Checks node/closing curly brackets to be the last symbols on the line.This is how a correct curly bracket structure should look like:
String[] array = new String[] { "first", "second" };
orString[] array = new String[] {"first", "second"};
The motivation for such formatting is simple - we want to see the entire block as fast as possible. When you look at a block of code you should be able to see where it starts and where it ends.
- Since:
- 0.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Constructor Summary
Constructors Constructor Description CurlyBracketsStructureCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
getAcceptableTokens()
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
visitToken(DetailAST ast)
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearMessages, destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setClassLoader, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Method Detail
-
getDefaultTokens
public int[] getDefaultTokens()
- Specified by:
getDefaultTokens
in classAbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()
- Specified by:
getAcceptableTokens
in classAbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()
- Specified by:
getRequiredTokens
in classAbstractCheck
-
visitToken
public void visitToken(DetailAST ast)
- Overrides:
visitToken
in classAbstractCheck
-
-