Class SpringTernaryCheck
java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
io.spring.javaformat.checkstyle.check.SpringTernaryCheck
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable,com.puppycrawl.tools.checkstyle.api.Contextualizable
public class SpringTernaryCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
Checks that ternary operations follow Spring conventions. All ternary tests should have
parentheses. Not equals to should be used rather than equals as the test for nulls.
- Author:
- Phillip Webb
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of equals operators allowed in the test condition.Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AutomaticBean.OutputStreamOptions -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]int[]int[]voidsetEqualsTest(String equalsTest) voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearViolations, destroy, finishTree, getFileContents, getLine, getLineCodePoints, getLines, getTabWidth, getTokenNames, getViolations, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensMethods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityMethods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Field Details
-
NO_REQUIRED_TOKENS
public static final int[] NO_REQUIRED_TOKENS
-
-
Constructor Details
-
SpringTernaryCheck
public SpringTernaryCheck()
-
-
Method Details
-
getAcceptableTokens
public int[] getAcceptableTokens()- Specified by:
getAcceptableTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST ast) - Overrides:
visitTokenin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
setEqualsTest
-
getDefaultTokens
public int[] getDefaultTokens()- Specified by:
getDefaultTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()- Specified by:
getRequiredTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-