Class PackageDeclarationCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public final class PackageDeclarationCheck
    extends AbstractCheck
    Ensures there is a package declaration. Optionally checks if directory structure matches package name. Rationale: Classes that live in the null package cannot be imported. Many novice developers are not aware of this. Packages provide logical namespace to classes and should be stored in the form of directory levels to provide physical grouping to your classes. These directories are added to the classpath so that your classes are visible to JVM when it runs the code.
    Author:
    Simon Harris, Oliver Burn, Vikramaditya Kukreja