|
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.BracesForTryCatchFinallyRule
class BracesForTryCatchFinallyRule extends AbstractAstVisitorRule
Checks the location of the opening brace ({) for try statements, the location of the 'catch' keyword and corresponding opening braces, and the location of the 'finally' keyword and the corresponding opening braces. By default, requires opening braces on the same line, but the sameLine property can be set to false to override this. By default does not validate catch and finally clauses, to turn this on set properties validateCatch and validateFinally to true respectively. The catch and finally handling defaults to using the sameLine value so if sameLine is true, we expect "} catch(x) {" and "} finally {". For fine grained control, use boolean properties catchOnSameLineAsClosingBrace, catchOnSameLineAsOpeningBrace, finallyOnSameLineAsClosingBrace, finallyOnSameLineAsOpeningBrace
| Property Summary | |
|---|---|
Class |
astVisitorClass
|
Boolean |
catchOnSameLineAsClosingBrace
|
Boolean |
catchOnSameLineAsOpeningBrace
|
Boolean |
finallyOnSameLineAsClosingBrace
|
Boolean |
finallyOnSameLineAsOpeningBrace
|
String |
name
|
int |
priority
|
boolean |
sameLine
|
boolean |
validateCatch
|
boolean |
validateFinally
|
| Property Detail |
|---|
Class astVisitorClass
Boolean catchOnSameLineAsClosingBrace
Boolean catchOnSameLineAsOpeningBrace
Boolean finallyOnSameLineAsClosingBrace
Boolean finallyOnSameLineAsOpeningBrace
String name
int priority
boolean sameLine
boolean validateCatch
boolean validateFinally
Groovy Documentation