com.puppycrawl.tools.checkstyle.checks.imports
public class ImportOrderCheck extends Check
Example:
<module name="ImportOrder"> <property name="groups" value="java,javax"/> <property name="ordered" value="true"/> <property name="caseSensitive" value="false"/> </module>There is always an additional, implied "everything else" package group. If no "groups" property is supplied, all imports belong in this "everything else" group.
ordered defaults to true.
separated defaults to false.
Compatible with Java 1.5 source.Constructor Summary | |
---|---|
ImportOrderCheck()
Default constructor. |
Method Summary | |
---|---|
void | beginTree(DetailAST aRootAST) {@inheritDoc} |
int[] | getDefaultTokens() {@inheritDoc} |
int[] | getRequiredTokens() {@inheritDoc} |
void | setCaseSensitive(boolean aCaseSensitive)
Sets whether string comparision should be case sensitive
or not. |
void | setGroups(String[] aGroups)
sets the list of package groups and the order they should
occur in the file.
|
void | setOrdered(boolean aOrdered)
Sets whether or not imports should be ordered within any one
group of imports.
|
void | setSeparated(boolean aSeparated)
Sets whether or not groups of imports must be separated from
one another by at least one blank line.
|
void | visitToken(DetailAST aAST) {@inheritDoc} |
Parameters: aCaseSensitive whether string comparision should be case sensitive.
Parameters: aGroups a comma-separated list of package names/prefixes
Parameters: aOrdered whether lexicographic ordering of imports within a group required or not.
Parameters: aSeparated whehter groups should be separated by blank line.