Class PackageNameCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class PackageNameCheck
    extends AbstractCheck
    Checks that package names conform to a specified pattern.

    The default value of format for module PackageName has been chosen to match the requirements in the Java Language specification and the Sun coding conventions. However, both underscores and uppercase letters are rather uncommon, so most configurations should probably assign value ^[a-z]+(\.[a-z][a-z0-9]*)*$ to format for module PackageName.

    • Property format - Control the pattern to match valid identifiers. Type is java.util.regex.Pattern. Default value is "^[a-z]+(\.[a-zA-Z_]\w*)*$".

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • name.invalidPattern
    Since:
    3.0