Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.puppycrawl.tools.checkstyle.checks.blocks: Javadoc index of package com.puppycrawl.tools.checkstyle.checks.blocks.


Package Samples:

com.puppycrawl.tools.checkstyle.checks.blocks

Classes:

LeftCurlyCheck: Checks the placement of left curly braces on types, methods and other the other blocks: LITERAL_CATCH 55 , LITERAL_DO 55 , LITERAL_ELSE 55 , LITERAL_FINALLY 55 , LITERAL_FOR 55 , LITERAL_IF 55 , LITERAL_SWITCH 55 , LITERAL_SYNCHRONIZED 55 , LITERAL_TRY 55 , LITERAL_WHILE 55 . The policy to verify is specified using the LeftCurlyOption class and defaults to LeftCurlyOption.EOL 55 . Policies LeftCurlyOption.EOL 55 and LeftCurlyOption.NLOW 55 take into account property maxLineLength. The default value for maxLineLength is 80. An example of how to configure the check is: <module name="LeftCurly"/> ...
EmptyBlockCheck: Checks for empty blocks. The policy to verify is specified using the BlockOption class and defaults to BlockOption.STMT 55 . By default the check will check the following blocks: LITERAL_WHILE 55 , LITERAL_TRY 55 , LITERAL_CATCH 55 , LITERAL_FINALLY 55 , LITERAL_DO 55 , LITERAL_IF 55 , LITERAL_ELSE 55 , LITERAL_FOR 55 , STATIC_INIT 55 . An example of how to configure the check is: <module name="EmptyBlock"/> An example of how to configure the check for the BlockOption.TEXT 55 policy and only catch blocks is: <module name="EmptyBlock"> <property name="tokens" value="LITERAL_CATCH"/> ...
RightCurlyCheck: Checks the placement of right curly braces. The policy to verify is specified using the RightCurlyOption class and defaults to RightCurlyOption.SAME 55 . By default the check will check the following tokens: LITERAL_CATCH 55 , LITERAL_ELSE 55 , LITERAL_TRY 55 . An example of how to configure the check is: <module name="RightCurly"/> An example of how to configure the check with policy RightCurlyOption.ALONE 55 for else tokens is: <module name="RightCurly"> <property name="tokens" value="LITERAL_ELSE"/> <property name="option" value="alone"/> </module>
AvoidNestedBlocksCheck: Finds nested blocks. For example this Check flags confusing code like public void guessTheOutput() { int whichIsWich = 0; { int whichIsWhich = 2; } System.out.println("value = " + whichIsWhich); } and debugging / refactoring leftovers such as // if (someOldCondition) { System.out.println("unconditional"); } A case in a switch statement does not implicitly form a block. Thus to be able to introduce local variables that have case scope it is necessary to open a nested block. This is supported, set the allowInSwitchCase property to true and include all statements of the case in the block. switch (a) ...
NeedBracesCheck: Checks for braces around code blocks. By default the check will check the following blocks: LITERAL_DO 55 , LITERAL_ELSE 55 , LITERAL_FOR 55 , LITERAL_IF 55 , LITERAL_WHILE 55 . An example of how to configure the check is: <module name="NeedBraces"/> An example of how to configure the check for if and else blocks is: <module name="NeedBraces"> <property name="tokens" value="LITERAL_IF, LITERAL_ELSE"/> </module>
RightCurlyOption: Represents the options for placing the right curly brace '}' .
LeftCurlyOption: Represents the options for placing the left curly brace '{' .
BlockOption: Represents the policy for checking block statements.
AvoidNestedBlocksCheckTest
EmptyBlockCheckTest
LeftCurlyCheckTest
NeedBracesCheckTest
RightCurlyCheckTest

Home | Contact Us | Privacy Policy | Terms of Service