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, visitTokengetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic OneTopLevelClassCheck()
public int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic void beginTree(DetailAST rootAST)
Checkpublic void finishTree(DetailAST rootAST)
CheckfinishTree in class CheckrootAST - the root of the treeCopyright © 2001–2015. All rights reserved.