Class RightCurlyCheck.Details
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.Details
- Enclosing class:
RightCurlyCheck
Structure that contains all details for validation.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static RightCurlyCheck.Details
getDetails
(DetailAST ast) Collects validation Details.private static RightCurlyCheck.Details
Collects validation details for LITERAL_IF and LITERAL_ELSE.private static RightCurlyCheck.Details
Collects validation details for loops' tokens.private static RightCurlyCheck.Details
Collects validation details for CLASS_DEF, RECORD_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, and COMPACT_CTOR_DEF.private static RightCurlyCheck.Details
Collects validation details for LITERAL_TRY, LITERAL_CATCH, and LITERAL_FINALLY.private static DetailAST
getNextToken
(DetailAST ast) Finds next token after the given one.private static boolean
isTokenWithNoChildSlist
(int tokenType) Tests whether the provided tokenType will never have a SLIST as child in its AST.
-
Field Details
-
TOKENS_WITH_NO_CHILD_SLIST
private static final int[] TOKENS_WITH_NO_CHILD_SLISTToken types that identify tokens that will never have SLIST in their AST. -
rcurly
Right curly. -
lcurly
Left curly. -
nextToken
Next token. -
shouldCheckLastRcurly
private final boolean shouldCheckLastRcurlyShould check last right curly.
-
-
Constructor Details
-
Details
private Details(DetailAST lcurly, DetailAST rcurly, DetailAST nextToken, boolean shouldCheckLastRcurly) Constructor.- Parameters:
lcurly
- the lcurly of the token whose details are being collectedrcurly
- the rcurly of the token whose details are being collectednextToken
- the token after the token whose details are being collectedshouldCheckLastRcurly
- boolean value to determine if to check last rcurly
-
-
Method Details
-
getDetails
Collects validation Details.- Parameters:
ast
- aDetailAST
value- Returns:
- object containing all details to make a validation
-
getDetailsForTryCatchFinally
Collects validation details for LITERAL_TRY, LITERAL_CATCH, and LITERAL_FINALLY.- Parameters:
ast
- aDetailAST
value- Returns:
- object containing all details to make a validation
-
getDetailsForIfElse
Collects validation details for LITERAL_IF and LITERAL_ELSE.- Parameters:
ast
- aDetailAST
value- Returns:
- object containing all details to make a validation
-
getDetailsForOthers
Collects validation details for CLASS_DEF, RECORD_DEF, METHOD DEF, CTOR_DEF, STATIC_INIT, INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, and COMPACT_CTOR_DEF.- Parameters:
ast
- aDetailAST
value- Returns:
- an object containing all details to make a validation
-
isTokenWithNoChildSlist
private static boolean isTokenWithNoChildSlist(int tokenType) Tests whether the provided tokenType will never have a SLIST as child in its AST. Like CLASS_DEF, ANNOTATION_DEF etc.- Parameters:
tokenType
- the tokenType to test against.- Returns:
- weather provided tokenType is definition token.
-
getDetailsForLoops
Collects validation details for loops' tokens.- Parameters:
ast
- aDetailAST
value- Returns:
- an object containing all details to make a validation
-
getNextToken
Finds next token after the given one.- Parameters:
ast
- the given node.- Returns:
- the token which represents next lexical item.
-