public final class UnnecessarySemicolonAfterOuterTypeDeclarationCheck extends AbstractCheck
Checks if unnecessary semicolon is used after type declaration.
This check is not applicable to nested type declarations, UnnecessarySemicolonAfterTypeMemberDeclaration is responsible for it.
tokens - tokens to check
Type is java.lang.String[].
Validation type is tokenSet.
Default value is:
CLASS_DEF,
INTERFACE_DEF,
ENUM_DEF,
ANNOTATION_DEF,
RECORD_DEF.
To configure the check:
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
Example:
class A {
class Nested {
}; // OK, nested type declarations are ignored
}; // violation
interface B {
}; // violation
enum C {
}; // violation
@interface D {
}; // violation
To configure the check to detect unnecessary semicolon only after top level class definitions:
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"> <property name="tokens" value="CLASS_DEF"/> </module>
Example:
class A {
}; // violation
interface B {
}; // OK
enum C {
}; // OK
@interface D {
}; // OK
Parent is com.puppycrawl.tools.checkstyle.TreeWalker
Violation Message Keys:
unnecessary.semicolon
AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MSG_SEMI
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
UnnecessarySemicolonAfterOuterTypeDeclarationCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
beginTree, clearMessages, destroy, finishTree, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityconfigure, contextualize, getConfiguration, setupChildpublic static final java.lang.String MSG_SEMI
public UnnecessarySemicolonAfterOuterTypeDeclarationCheck()
public int[] getDefaultTokens()
AbstractCheckgetDefaultTokens in class AbstractCheckTokenTypespublic int[] getAcceptableTokens()
AbstractCheckgetAcceptableTokens in class AbstractCheckTokenTypespublic int[] getRequiredTokens()
AbstractCheckgetRequiredTokens in class AbstractCheckTokenTypespublic void visitToken(DetailAST ast)
AbstractCheckvisitToken in class AbstractCheckast - the token to processCopyright © 2001-2020. All Rights Reserved.