com.puppycrawl.tools.checkstyle.checks.coding

Class PackageDeclarationCheck

Implemented Interfaces:
Configurable, Contextualizable

public final class PackageDeclarationCheck
extends Check

Ensures there is a package declaration. Rationale: Classes that live in the null package cannot be imported. Many novice developers are not aware of this.
Author:
Simon Harris

Method Summary

void
beginTree(DetailAST aAST)
void
finishTree(DetailAST aAST)
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
visitToken(DetailAST aAST)

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

getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setId, setSeverity

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

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Method Details

beginTree

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

finishTree

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

getDefaultTokens

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

getRequiredTokens

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

visitToken

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