|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD | |||||||
java.lang.Objectorg.codenarc.rule.AbstractAstVisitorRule
groovy.org.codenarc.rule.formatting.BracesForIfElseRule
class BracesForIfElseRule extends AbstractAstVisitorRule
Checks the location of the opening brace ({) for if statements and optionally closing and opening braces for else statements. By default, requires them on the same line, but the sameLine property can be set to false to override this. To enable else checking, set the validateElse property to true. For more fine grained control, use boolean properties elseOnSameLineAsClosingBrace and elseOnSameLineAsOpeningBrace Example:
if (x) { //A
} else if (y) { //B
} else { //C
}
A - checked and defaults to no errors since the brace is on the same line | Property Summary | |
|---|---|
Class |
astVisitorClass
|
Boolean |
elseOnSameLineAsClosingBrace
|
Boolean |
elseOnSameLineAsOpeningBrace
|
String |
name
|
int |
priority
|
boolean |
sameLine
|
boolean |
validateElse
|
| Property Detail |
|---|
Class astVisitorClass
Boolean elseOnSameLineAsClosingBrace
Boolean elseOnSameLineAsOpeningBrace
String name
int priority
boolean sameLine
boolean validateElse
Groovy Documentation