Style checker that enforces import ordering. The following configuration parameters are
available:
groups: a comma-separated list of group names to consider.
maxBlankLines: maximum number of blank lines to allow between groups. The default is "1".
A value less than 1 disables the blank line limit.
group.[groupName]: a regular expression that matches imports that should be in the given
group.
lexicographic: if true, imports are ordered lexicographically (classes, wildcards, then
packages; case-sensitive ordering within); if false, apply the original
case-insensitive ordering (with wildcards coming first, before classes).
For example, to check that "java" and "javax" imports are in a separate group at the top of the
import list, you'd use this config:
Other non-configurable rules:
- Within each group, import clauses are ordered alphabetically if 'lexicographic' is
specified; else puts wildcards, then classes and packages, with case-insensitive sort.
- In multi-import statements, entries are ordered alphabetically, with method / packages
(assumed to be any string starting with a lower case letter) coming before classes.
Currently, this checker only looks at the top-level list of imports.
Style checker that enforces import ordering. The following configuration parameters are available:
For example, to check that "java" and "javax" imports are in a separate group at the top of the import list, you'd use this config:
<parameter name="groups">java,others</parameter> <parameter name="group.java">javax?\..+</parameter> <parameter name="group.other">.+</parameter>
Other non-configurable rules: - Within each group, import clauses are ordered alphabetically if 'lexicographic' is specified; else puts wildcards, then classes and packages, with case-insensitive sort. - In multi-import statements, entries are ordered alphabetically, with method / packages (assumed to be any string starting with a lower case letter) coming before classes.
Currently, this checker only looks at the top-level list of imports.