com.puppycrawl.tools.checkstyle.checks.blocks

Class RightCurlyCheck

Implemented Interfaces:
Configurable, Contextualizable

public class RightCurlyCheck
extends AbstractOptionCheck

Checks the placement of right curly braces. The policy to verify is specified using the RightCurlyOption class and defaults to RightCurlyOption.SAME.

By default the check will check the following tokens: LITERAL_CATCH, LITERAL_ELSE, LITERAL_TRY.

An example of how to configure the check is:

 <module name="RightCurly"/>
 

An example of how to configure the check with policy RightCurlyOption.ALONE for else tokens is:

 <module name="RightCurly">
     <property name="tokens" value="LITERAL_ELSE"/>
     <property name="option" value="alone"/>
 </module>
 

Version:
1.0

Authors:
Oliver Burn
lkuehne

Constructor Summary

RightCurlyCheck()
Sets the right curly option to same.

Method Summary

int[]
getDefaultTokens()
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractOptionCheck

getAbstractOption, setOption

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

RightCurlyCheck

public RightCurlyCheck()
Sets the right curly option to same.

Method Details

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

See Also:
Check


visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface Check

See Also:
Check