Groovy Documentation

groovy.org.codenarc.rule.naming
[Groovy] Class PackageNameRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.naming.PackageNameRule

class PackageNameRule
extends AbstractAstVisitorRule

Rule that verifies that the package name of a class matches a regular expression. By default it checks that the package name consists of only lowercase letters and numbers, separated by periods.

The regex property specifies the regular expression to check the package name against. It is required and cannot be null or empty. It defaults to '[a-z]+(\.[a-z0-9]+)*'.

The packageNameRequired property indicates whether a package name declaration is required for all classes. It defaults to false.

Authors:
Chris Mair
Hamlet D'Arcy


Property Summary
Class astVisitorClass

String name

boolean packageNameRequired

int priority

String regex

 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


packageNameRequired

boolean packageNameRequired


priority

int priority


regex

String regex


 

Groovy Documentation