public class OneTopLevelClassCheck extends Check
Official description of a 'top-level' term: 7.6. Top Level Type Declarations. If file doesn't contains public class, enum or interface, top-level type is the first type in file.
An example of code with violations:
public class Foo{
//methods
}
class Foo2{
//methods
}
An example of code without top-level public type:
class Foo{ //top-level class
//methods
}
class Foo2{
//methods
}
An example of check's configuration:
<module name="OneTopLevelClass"/>
An example of code without violations:
public class Foo{
//methods
}
Constructor and Description |
---|
OneTopLevelClassCheck() |
Modifier and Type | Method and Description |
---|---|
void |
beginTree(DetailAST rootAST)
Called before the starting to process a tree.
|
void |
finishTree(DetailAST rootAST)
Called after finished processing a tree.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
destroy, getAcceptableTokens, getClassLoader, getFileContents, getLine, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
public OneTopLevelClassCheck()
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public void beginTree(DetailAST rootAST)
Check
public void finishTree(DetailAST rootAST)
Check
finishTree
in class Check
rootAST
- the root of the treeCopyright © 2001–2015. All rights reserved.