View Javadoc
1   ///////////////////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code and other text files for adherence to a set of rules.
3   // Copyright (C) 2001-2024 the original author or authors.
4   //
5   // This library is free software; you can redistribute it and/or
6   // modify it under the terms of the GNU Lesser General Public
7   // License as published by the Free Software Foundation; either
8   // version 2.1 of the License, or (at your option) any later version.
9   //
10  // This library is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // Lesser General Public License for more details.
14  //
15  // You should have received a copy of the GNU Lesser General Public
16  // License along with this library; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ///////////////////////////////////////////////////////////////////////////////////////////////
19  
20  package com.puppycrawl.tools.checkstyle;
21  
22  import java.io.IOException;
23  import java.util.Collections;
24  import java.util.HashMap;
25  import java.util.HashSet;
26  import java.util.LinkedHashSet;
27  import java.util.List;
28  import java.util.Map;
29  import java.util.Map.Entry;
30  import java.util.Set;
31  import java.util.function.Supplier;
32  import java.util.stream.Collectors;
33  import java.util.stream.Stream;
34  
35  import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
36  import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil;
37  
38  /**
39   * A factory for creating objects from package names and names.
40   * Consider the below example for better understanding.
41   * <ul>
42   *     <li>module name - name of java class that represents module;</li>
43   *     <li>module full name - fully qualifies name of java class that represents module;</li>
44   *     <li>check module short name - name of Check without 'Check' suffix;</li>
45   *     <li>check module name - name of java class that represents Check (with 'Check' suffix);</li>
46   *     <li>
47   *         check module full name - fully qualifies name of java class
48   *         that represents Check (with 'Check' suffix).
49   *     </li>
50   * </ul>
51   */
52  public class PackageObjectFactory implements ModuleFactory {
53  
54      /**
55       * Enum class to define loading options.
56       */
57      public enum ModuleLoadOption {
58  
59          /**
60           * Searching from registered checkstyle modules and from packages given in constructor.
61           **/
62          SEARCH_REGISTERED_PACKAGES,
63          /**
64           * As SEARCH_REGISTERED_PACKAGES and also try to load class from all of packages given in
65           * constructor.
66           * Required for eclipse-cs plugin.
67           **/
68          TRY_IN_ALL_REGISTERED_PACKAGES,
69  
70      }
71  
72      /** Base package of checkstyle modules checks. */
73      public static final String BASE_PACKAGE = "com.puppycrawl.tools.checkstyle";
74  
75      /** Exception message when it is unable to create a class instance. */
76      public static final String UNABLE_TO_INSTANTIATE_EXCEPTION_MESSAGE =
77              "PackageObjectFactory.unableToInstantiateExceptionMessage";
78  
79      /** Exception message when there is ambiguous module name in config file. */
80      public static final String AMBIGUOUS_MODULE_NAME_EXCEPTION_MESSAGE =
81              "PackageObjectFactory.ambiguousModuleNameExceptionMessage";
82  
83      /** Suffix of checks. */
84      public static final String CHECK_SUFFIX = "Check";
85  
86      /** Character separate package names in qualified name of java class. */
87      public static final String PACKAGE_SEPARATOR = ".";
88  
89      /** Exception message when null class loader is given. */
90      public static final String NULL_LOADER_MESSAGE = "moduleClassLoader must not be null";
91  
92      /** Exception message when null package name is given. */
93      public static final String NULL_PACKAGE_MESSAGE = "package name must not be null";
94  
95      /** Separator to use in strings. */
96      public static final String STRING_SEPARATOR = ", ";
97  
98      /** Map of Checkstyle module names to their fully qualified names. */
99      private static final Map<String, String> NAME_TO_FULL_MODULE_NAME = new HashMap<>();
100 
101     /** Package names to prepend to class names. */
102     private final Set<String> packages;
103 
104     /** The class loader used to load Checkstyle core and custom modules. */
105     private final ClassLoader moduleClassLoader;
106 
107     /** Map of third party Checkstyle module names to the set of their fully qualified names. */
108     private Map<String, Set<String>> thirdPartyNameToFullModuleNames;
109 
110     /** Module load option which defines class search type. */
111     private ModuleLoadOption moduleLoadOption;
112 
113     static {
114         fillShortToFullModuleNamesMap();
115     }
116 
117     /**
118      * Creates a new {@code PackageObjectFactory} instance.
119      *
120      * @param packageNames package names to use
121      * @param moduleClassLoader class loader used to load Checkstyle
122      *          core and custom modules
123      */
124     public PackageObjectFactory(Set<String> packageNames, ClassLoader moduleClassLoader) {
125         this(packageNames, moduleClassLoader, ModuleLoadOption.SEARCH_REGISTERED_PACKAGES);
126     }
127 
128     /**
129      * Creates a new {@code PackageObjectFactory} instance.
130      *
131      * @param packageNames package names to use
132      * @param moduleClassLoader class loader used to load Checkstyle
133      *          core and custom modules
134      * @param moduleLoadOption loading option
135      * @throws IllegalArgumentException if moduleClassLoader is null or packageNames contains null
136      */
137     public PackageObjectFactory(Set<String> packageNames, ClassLoader moduleClassLoader,
138             ModuleLoadOption moduleLoadOption) {
139         if (moduleClassLoader == null) {
140             throw new IllegalArgumentException(NULL_LOADER_MESSAGE);
141         }
142         if (packageNames.contains(null)) {
143             throw new IllegalArgumentException(NULL_PACKAGE_MESSAGE);
144         }
145 
146         // create a copy of the given set, but retain ordering
147         packages = new LinkedHashSet<>(packageNames);
148         this.moduleClassLoader = moduleClassLoader;
149         this.moduleLoadOption = moduleLoadOption;
150     }
151 
152     /**
153      * Creates a new {@code PackageObjectFactory} instance.
154      *
155      * @param packageName The package name to use
156      * @param moduleClassLoader class loader used to load Checkstyle
157      *          core and custom modules
158      * @throws IllegalArgumentException if moduleClassLoader is null or packageNames is null
159      */
160     public PackageObjectFactory(String packageName, ClassLoader moduleClassLoader) {
161         if (moduleClassLoader == null) {
162             throw new IllegalArgumentException(NULL_LOADER_MESSAGE);
163         }
164         if (packageName == null) {
165             throw new IllegalArgumentException(NULL_PACKAGE_MESSAGE);
166         }
167 
168         packages = Collections.singleton(packageName);
169         this.moduleClassLoader = moduleClassLoader;
170     }
171 
172     /**
173      * Creates a new instance of a class from a given name, or that name
174      * concatenated with &quot;Check&quot;. If the name is
175      * a class name, creates an instance of the named class. Otherwise, creates
176      * an instance of a class name obtained by concatenating the given name
177      * to a package name from a given list of package names.
178      *
179      * @param name the name of a class.
180      * @return the {@code Object} created by loader.
181      * @throws CheckstyleException if an error occurs.
182      */
183     @Override
184     public Object createModule(String name) throws CheckstyleException {
185         Object instance = null;
186         // if the name is a simple class name, try to find it in maps at first
187         if (!name.contains(PACKAGE_SEPARATOR)) {
188             instance = createFromStandardCheckSet(name);
189             // find the name in third party map
190             if (instance == null) {
191                 instance = createObjectFromClassPath(name);
192             }
193         }
194         if (instance == null) {
195             instance = createObject(name);
196         }
197         if (instance == null
198                 && moduleLoadOption == ModuleLoadOption.TRY_IN_ALL_REGISTERED_PACKAGES) {
199             instance = createModuleByTryInEachPackage(name);
200         }
201         if (instance == null) {
202             String attemptedNames = null;
203             if (!name.contains(PACKAGE_SEPARATOR)) {
204                 final String nameCheck = name + CHECK_SUFFIX;
205                 attemptedNames = joinPackageNamesWithClassName(name, packages)
206                         + STRING_SEPARATOR + nameCheck + STRING_SEPARATOR
207                         + joinPackageNamesWithClassName(nameCheck, packages);
208             }
209             final LocalizedMessage exceptionMessage = new LocalizedMessage(
210                 Definitions.CHECKSTYLE_BUNDLE, getClass(),
211                 UNABLE_TO_INSTANTIATE_EXCEPTION_MESSAGE, name, attemptedNames);
212             throw new CheckstyleException(exceptionMessage.getMessage());
213         }
214         return instance;
215     }
216 
217     /**
218      * Create object from one of Checkstyle module names.
219      *
220      * @param name name of module.
221      * @return instance of module.
222      * @throws CheckstyleException if the class fails to instantiate or there are ambiguous classes.
223      */
224     private Object createFromStandardCheckSet(String name) throws CheckstyleException {
225         final String fullModuleName = NAME_TO_FULL_MODULE_NAME.get(name);
226         Object instance = null;
227         if (fullModuleName == null) {
228             final String fullCheckModuleName =
229                     NAME_TO_FULL_MODULE_NAME.get(name + CHECK_SUFFIX);
230             if (fullCheckModuleName != null) {
231                 instance = createObject(fullCheckModuleName);
232             }
233         }
234         else {
235             instance = createObject(fullModuleName);
236         }
237         return instance;
238     }
239 
240     /**
241      * Create object with the help of the classpath.
242      *
243      * @param name name of module.
244      * @return instance of module if it is found in modules map and no ambiguous classes exist.
245      * @throws CheckstyleException if the class fails to instantiate or there are ambiguous classes.
246      */
247     private Object createObjectFromClassPath(String name)
248             throws CheckstyleException {
249         thirdPartyNameToFullModuleNames = lazyLoad(
250                 thirdPartyNameToFullModuleNames,
251                 () -> generateThirdPartyNameToFullModuleName(moduleClassLoader)
252         );
253         final Set<String> fullModuleNames = thirdPartyNameToFullModuleNames.get(name);
254         Object instance = null;
255         if (fullModuleNames == null) {
256             final Set<String> fullCheckModuleNames =
257                     thirdPartyNameToFullModuleNames.get(name + CHECK_SUFFIX);
258             if (fullCheckModuleNames != null) {
259                 instance = createObjectFromFullModuleNames(name, fullCheckModuleNames);
260             }
261         }
262         else {
263             instance = createObjectFromFullModuleNames(name, fullModuleNames);
264         }
265         return instance;
266     }
267 
268     /**
269      * Create Object from optional full module names.
270      * In most case, there should be only one element in {@code fullModuleName}, otherwise
271      * an exception would be thrown.
272      *
273      * @param name name of module
274      * @param fullModuleNames the supplied full module names set
275      * @return instance of module if there is only one element in {@code fullModuleName}
276      * @throws CheckstyleException if the class fails to instantiate or there are more than one
277      *      element in {@code fullModuleName}
278      */
279     private Object createObjectFromFullModuleNames(String name, Set<String> fullModuleNames)
280             throws CheckstyleException {
281         final Object returnValue;
282         if (fullModuleNames.size() == 1) {
283             returnValue = createObject(fullModuleNames.iterator().next());
284         }
285         else {
286             final String optionalNames = fullModuleNames.stream()
287                     .sorted()
288                     .collect(Collectors.joining(STRING_SEPARATOR));
289             final LocalizedMessage exceptionMessage = new LocalizedMessage(
290                     Definitions.CHECKSTYLE_BUNDLE, getClass(),
291                     AMBIGUOUS_MODULE_NAME_EXCEPTION_MESSAGE, name, optionalNames);
292             throw new CheckstyleException(exceptionMessage.getMessage());
293         }
294         return returnValue;
295     }
296 
297     /**
298      * Generate the map of third party Checkstyle module names to the set of their fully qualified
299      * names.
300      *
301      * @param loader the class loader used to load Checkstyle package names
302      * @return the map of third party Checkstyle module names to the set of their fully qualified
303      *      names
304      */
305     private Map<String, Set<String>> generateThirdPartyNameToFullModuleName(ClassLoader loader) {
306         Map<String, Set<String>> returnValue;
307         try {
308             returnValue = ModuleReflectionUtil.getCheckstyleModules(packages, loader).stream()
309                 .collect(Collectors.groupingBy(Class::getSimpleName,
310                     Collectors.mapping(
311                         Class::getCanonicalName,
312                         Collectors.toCollection(HashSet::new))));
313         }
314         catch (IOException ignore) {
315             returnValue = Collections.emptyMap();
316         }
317         return returnValue;
318     }
319 
320     /**
321      * Returns simple check name from full modules names map.
322      *
323      * @param fullName name of the class for joining.
324      * @return simple check name.
325      */
326     public static String getShortFromFullModuleNames(String fullName) {
327         return NAME_TO_FULL_MODULE_NAME
328                 .entrySet()
329                 .stream()
330                 .filter(entry -> entry.getValue().equals(fullName))
331                 .map(Entry::getKey)
332                 .findFirst()
333                 .orElse(fullName);
334     }
335 
336     /**
337      * Creates a string by joining package names with a class name.
338      *
339      * @param className name of the class for joining.
340      * @param packages packages names.
341      * @return a string which is obtained by joining package names with a class name.
342      */
343     private static String joinPackageNamesWithClassName(String className, Set<String> packages) {
344         return packages.stream().collect(
345             Collectors.joining(PACKAGE_SEPARATOR + className + STRING_SEPARATOR, "",
346                     PACKAGE_SEPARATOR + className));
347     }
348 
349     /**
350      * Creates a new instance of a named class.
351      *
352      * @param className the name of the class to instantiate.
353      * @return the {@code Object} created by loader or null.
354      * @throws CheckstyleException if the class fails to instantiate.
355      */
356     private Object createObject(String className) throws CheckstyleException {
357         Class<?> clazz = null;
358 
359         try {
360             clazz = Class.forName(className, true, moduleClassLoader);
361         }
362         catch (final ReflectiveOperationException | NoClassDefFoundError ignored) {
363             // ignore the exception
364         }
365 
366         Object instance = null;
367 
368         if (clazz != null) {
369             try {
370                 instance = clazz.getDeclaredConstructor().newInstance();
371             }
372             catch (final ReflectiveOperationException ex) {
373                 throw new CheckstyleException("Unable to instantiate " + className, ex);
374             }
375         }
376 
377         return instance;
378     }
379 
380     /**
381      * Searching to class with given name (or name concatenated with &quot;Check&quot;) in existing
382      * packages. Returns instance if class found or, otherwise, null.
383      *
384      * @param name the name of a class.
385      * @return the {@code Object} created by loader.
386      * @throws CheckstyleException if an error occurs.
387      */
388     private Object createModuleByTryInEachPackage(String name) throws CheckstyleException {
389         final List<String> possibleNames = packages.stream()
390             .map(packageName -> packageName + PACKAGE_SEPARATOR + name)
391             .flatMap(className -> Stream.of(className, className + CHECK_SUFFIX))
392             .collect(Collectors.toUnmodifiableList());
393         Object instance = null;
394         for (String possibleName : possibleNames) {
395             instance = createObject(possibleName);
396             if (instance != null) {
397                 break;
398             }
399         }
400         return instance;
401     }
402 
403     /**
404      * Initialize object by supplier if object is null.
405      *
406      * @param <T> type of object
407      * @param object object to initialize
408      * @param supplier function to initialize if object is null
409      * @return object as it was provided in method or initialized
410      */
411     private static <T> T lazyLoad(T object, Supplier<T> supplier) {
412         final T result;
413         if (object == null) {
414             result = supplier.get();
415         }
416         else {
417             result = object;
418         }
419         return result;
420     }
421 
422     /**
423      * Fill short-to-full module names map.
424      */
425     private static void fillShortToFullModuleNamesMap() {
426         fillChecksFromAnnotationPackage();
427         fillChecksFromBlocksPackage();
428         fillChecksFromCodingPackage();
429         fillChecksFromDesignPackage();
430         fillChecksFromHeaderPackage();
431         fillChecksFromImportsPackage();
432         fillChecksFromIndentationPackage();
433         fillChecksFromJavadocPackage();
434         fillChecksFromMetricsPackage();
435         fillChecksFromModifierPackage();
436         fillChecksFromNamingPackage();
437         fillChecksFromRegexpPackage();
438         fillChecksFromSizesPackage();
439         fillChecksFromWhitespacePackage();
440         fillModulesFromChecksPackage();
441         fillModulesFromFilefiltersPackage();
442         fillModulesFromFiltersPackage();
443         fillModulesFromCheckstylePackage();
444     }
445 
446     /**
447      * Fill short-to-full module names map with Checks from annotation package.
448      */
449     private static void fillChecksFromAnnotationPackage() {
450         NAME_TO_FULL_MODULE_NAME.put("AnnotationLocationCheck",
451                 BASE_PACKAGE + ".checks.annotation.AnnotationLocationCheck");
452         NAME_TO_FULL_MODULE_NAME.put("AnnotationOnSameLineCheck",
453                 BASE_PACKAGE + ".checks.annotation.AnnotationOnSameLineCheck");
454         NAME_TO_FULL_MODULE_NAME.put("AnnotationUseStyleCheck",
455                 BASE_PACKAGE + ".checks.annotation.AnnotationUseStyleCheck");
456         NAME_TO_FULL_MODULE_NAME.put("MissingDeprecatedCheck",
457                 BASE_PACKAGE + ".checks.annotation.MissingDeprecatedCheck");
458         NAME_TO_FULL_MODULE_NAME.put("MissingOverrideCheck",
459                 BASE_PACKAGE + ".checks.annotation.MissingOverrideCheck");
460         NAME_TO_FULL_MODULE_NAME.put("PackageAnnotationCheck",
461                 BASE_PACKAGE + ".checks.annotation.PackageAnnotationCheck");
462         NAME_TO_FULL_MODULE_NAME.put("SuppressWarningsCheck",
463                 BASE_PACKAGE + ".checks.annotation.SuppressWarningsCheck");
464     }
465 
466     /**
467      * Fill short-to-full module names map with Checks from blocks package.
468      */
469     private static void fillChecksFromBlocksPackage() {
470         NAME_TO_FULL_MODULE_NAME.put("AvoidNestedBlocksCheck",
471                 BASE_PACKAGE + ".checks.blocks.AvoidNestedBlocksCheck");
472         NAME_TO_FULL_MODULE_NAME.put("EmptyBlockCheck",
473                 BASE_PACKAGE + ".checks.blocks.EmptyBlockCheck");
474         NAME_TO_FULL_MODULE_NAME.put("EmptyCatchBlockCheck",
475                 BASE_PACKAGE + ".checks.blocks.EmptyCatchBlockCheck");
476         NAME_TO_FULL_MODULE_NAME.put("LeftCurlyCheck",
477                 BASE_PACKAGE + ".checks.blocks.LeftCurlyCheck");
478         NAME_TO_FULL_MODULE_NAME.put("NeedBracesCheck",
479                 BASE_PACKAGE + ".checks.blocks.NeedBracesCheck");
480         NAME_TO_FULL_MODULE_NAME.put("RightCurlyCheck",
481                 BASE_PACKAGE + ".checks.blocks.RightCurlyCheck");
482     }
483 
484     /**
485      * Fill short-to-full module names map with Checks from coding package.
486      */
487     // -@cs[ExecutableStatementCount] splitting this method is not reasonable.
488     // -@cs[JavaNCSS] splitting this method is not reasonable.
489     private static void fillChecksFromCodingPackage() {
490         NAME_TO_FULL_MODULE_NAME.put("ArrayTrailingCommaCheck",
491                 BASE_PACKAGE + ".checks.coding.ArrayTrailingCommaCheck");
492         NAME_TO_FULL_MODULE_NAME.put("AvoidDoubleBraceInitializationCheck",
493                 BASE_PACKAGE + ".checks.coding.AvoidDoubleBraceInitializationCheck");
494         NAME_TO_FULL_MODULE_NAME.put("AvoidInlineConditionalsCheck",
495                 BASE_PACKAGE + ".checks.coding.AvoidInlineConditionalsCheck");
496         NAME_TO_FULL_MODULE_NAME.put("AvoidNoArgumentSuperConstructorCallCheck",
497                 BASE_PACKAGE + ".checks.coding.AvoidNoArgumentSuperConstructorCallCheck");
498         NAME_TO_FULL_MODULE_NAME.put("ConstructorsDeclarationGroupingCheck",
499                 BASE_PACKAGE + ".checks.coding.ConstructorsDeclarationGroupingCheck");
500         NAME_TO_FULL_MODULE_NAME.put("CovariantEqualsCheck",
501                 BASE_PACKAGE + ".checks.coding.CovariantEqualsCheck");
502         NAME_TO_FULL_MODULE_NAME.put("DeclarationOrderCheck",
503                 BASE_PACKAGE + ".checks.coding.DeclarationOrderCheck");
504         NAME_TO_FULL_MODULE_NAME.put("DefaultComesLastCheck",
505                 BASE_PACKAGE + ".checks.coding.DefaultComesLastCheck");
506         NAME_TO_FULL_MODULE_NAME.put("EmptyStatementCheck",
507                 BASE_PACKAGE + ".checks.coding.EmptyStatementCheck");
508         NAME_TO_FULL_MODULE_NAME.put("EqualsAvoidNullCheck",
509                 BASE_PACKAGE + ".checks.coding.EqualsAvoidNullCheck");
510         NAME_TO_FULL_MODULE_NAME.put("EqualsHashCodeCheck",
511                 BASE_PACKAGE + ".checks.coding.EqualsHashCodeCheck");
512         NAME_TO_FULL_MODULE_NAME.put("ExplicitInitializationCheck",
513                 BASE_PACKAGE + ".checks.coding.ExplicitInitializationCheck");
514         NAME_TO_FULL_MODULE_NAME.put("FallThroughCheck",
515                 BASE_PACKAGE + ".checks.coding.FallThroughCheck");
516         NAME_TO_FULL_MODULE_NAME.put("FinalLocalVariableCheck",
517                 BASE_PACKAGE + ".checks.coding.FinalLocalVariableCheck");
518         NAME_TO_FULL_MODULE_NAME.put("HiddenFieldCheck",
519                 BASE_PACKAGE + ".checks.coding.HiddenFieldCheck");
520         NAME_TO_FULL_MODULE_NAME.put("IllegalCatchCheck",
521                 BASE_PACKAGE + ".checks.coding.IllegalCatchCheck");
522         NAME_TO_FULL_MODULE_NAME.put("IllegalInstantiationCheck",
523                 BASE_PACKAGE + ".checks.coding.IllegalInstantiationCheck");
524         NAME_TO_FULL_MODULE_NAME.put("IllegalThrowsCheck",
525                 BASE_PACKAGE + ".checks.coding.IllegalThrowsCheck");
526         NAME_TO_FULL_MODULE_NAME.put("IllegalTokenCheck",
527                 BASE_PACKAGE + ".checks.coding.IllegalTokenCheck");
528         NAME_TO_FULL_MODULE_NAME.put("IllegalTokenTextCheck",
529                 BASE_PACKAGE + ".checks.coding.IllegalTokenTextCheck");
530         NAME_TO_FULL_MODULE_NAME.put("IllegalTypeCheck",
531                 BASE_PACKAGE + ".checks.coding.IllegalTypeCheck");
532         NAME_TO_FULL_MODULE_NAME.put("InnerAssignmentCheck",
533                 BASE_PACKAGE + ".checks.coding.InnerAssignmentCheck");
534         NAME_TO_FULL_MODULE_NAME.put("MagicNumberCheck",
535                 BASE_PACKAGE + ".checks.coding.MagicNumberCheck");
536         NAME_TO_FULL_MODULE_NAME.put("MissingCtorCheck",
537                 BASE_PACKAGE + ".checks.coding.MissingCtorCheck");
538         NAME_TO_FULL_MODULE_NAME.put("MissingSwitchDefaultCheck",
539                 BASE_PACKAGE + ".checks.coding.MissingSwitchDefaultCheck");
540         NAME_TO_FULL_MODULE_NAME.put("ModifiedControlVariableCheck",
541                 BASE_PACKAGE + ".checks.coding.ModifiedControlVariableCheck");
542         NAME_TO_FULL_MODULE_NAME.put("MultipleStringLiteralsCheck",
543                 BASE_PACKAGE + ".checks.coding.MultipleStringLiteralsCheck");
544         NAME_TO_FULL_MODULE_NAME.put("MultipleVariableDeclarationsCheck",
545                 BASE_PACKAGE + ".checks.coding.MultipleVariableDeclarationsCheck");
546         NAME_TO_FULL_MODULE_NAME.put("NestedForDepthCheck",
547                 BASE_PACKAGE + ".checks.coding.NestedForDepthCheck");
548         NAME_TO_FULL_MODULE_NAME.put("NestedIfDepthCheck",
549                 BASE_PACKAGE + ".checks.coding.NestedIfDepthCheck");
550         NAME_TO_FULL_MODULE_NAME.put("NestedTryDepthCheck",
551                 BASE_PACKAGE + ".checks.coding.NestedTryDepthCheck");
552         NAME_TO_FULL_MODULE_NAME.put("NoCloneCheck",
553                 BASE_PACKAGE + ".checks.coding.NoCloneCheck");
554         NAME_TO_FULL_MODULE_NAME.put("NoEnumTrailingCommaCheck",
555                 BASE_PACKAGE + ".checks.coding.NoEnumTrailingCommaCheck");
556         NAME_TO_FULL_MODULE_NAME.put("NoFinalizerCheck",
557                 BASE_PACKAGE + ".checks.coding.NoFinalizerCheck");
558         NAME_TO_FULL_MODULE_NAME.put("OneStatementPerLineCheck",
559                 BASE_PACKAGE + ".checks.coding.OneStatementPerLineCheck");
560         NAME_TO_FULL_MODULE_NAME.put("OverloadMethodsDeclarationOrderCheck",
561                 BASE_PACKAGE + ".checks.coding.OverloadMethodsDeclarationOrderCheck");
562         NAME_TO_FULL_MODULE_NAME.put("PackageDeclarationCheck",
563                 BASE_PACKAGE + ".checks.coding.PackageDeclarationCheck");
564         NAME_TO_FULL_MODULE_NAME.put("ParameterAssignmentCheck",
565                 BASE_PACKAGE + ".checks.coding.ParameterAssignmentCheck");
566         NAME_TO_FULL_MODULE_NAME.put("RequireThisCheck",
567                 BASE_PACKAGE + ".checks.coding.RequireThisCheck");
568         NAME_TO_FULL_MODULE_NAME.put("ReturnCountCheck",
569                 BASE_PACKAGE + ".checks.coding.ReturnCountCheck");
570         NAME_TO_FULL_MODULE_NAME.put("SimplifyBooleanExpressionCheck",
571                 BASE_PACKAGE + ".checks.coding.SimplifyBooleanExpressionCheck");
572         NAME_TO_FULL_MODULE_NAME.put("SimplifyBooleanReturnCheck",
573                 BASE_PACKAGE + ".checks.coding.SimplifyBooleanReturnCheck");
574         NAME_TO_FULL_MODULE_NAME.put("StringLiteralEqualityCheck",
575                 BASE_PACKAGE + ".checks.coding.StringLiteralEqualityCheck");
576         NAME_TO_FULL_MODULE_NAME.put("SuperCloneCheck",
577                 BASE_PACKAGE + ".checks.coding.SuperCloneCheck");
578         NAME_TO_FULL_MODULE_NAME.put("SuperFinalizeCheck",
579                 BASE_PACKAGE + ".checks.coding.SuperFinalizeCheck");
580         NAME_TO_FULL_MODULE_NAME.put("UnnecessaryParenthesesCheck",
581                 BASE_PACKAGE + ".checks.coding.UnnecessaryParenthesesCheck");
582         NAME_TO_FULL_MODULE_NAME.put("UnnecessarySemicolonAfterOuterTypeDeclarationCheck",
583                 BASE_PACKAGE
584                         + ".checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck");
585         NAME_TO_FULL_MODULE_NAME.put("UnnecessarySemicolonAfterTypeMemberDeclarationCheck",
586                 BASE_PACKAGE
587                     + ".checks.coding.UnnecessarySemicolonAfterTypeMemberDeclarationCheck");
588         NAME_TO_FULL_MODULE_NAME.put("UnnecessarySemicolonInEnumerationCheck",
589                 BASE_PACKAGE + ".checks.coding.UnnecessarySemicolonInEnumerationCheck");
590         NAME_TO_FULL_MODULE_NAME.put("UnnecessarySemicolonInTryWithResourcesCheck",
591                 BASE_PACKAGE + ".checks.coding.UnnecessarySemicolonInTryWithResourcesCheck");
592         NAME_TO_FULL_MODULE_NAME.put("VariableDeclarationUsageDistanceCheck",
593                 BASE_PACKAGE + ".checks.coding.VariableDeclarationUsageDistanceCheck");
594         NAME_TO_FULL_MODULE_NAME.put("NoArrayTrailingCommaCheck",
595                 BASE_PACKAGE + ".checks.coding.NoArrayTrailingCommaCheck");
596         NAME_TO_FULL_MODULE_NAME.put("MatchXpathCheck",
597                 BASE_PACKAGE + ".checks.coding.MatchXpathCheck");
598         NAME_TO_FULL_MODULE_NAME.put("UnusedLocalVariableCheck",
599                 BASE_PACKAGE + ".checks.coding.UnusedLocalVariableCheck");
600     }
601 
602     /**
603      * Fill short-to-full module names map with Checks from design package.
604      */
605     private static void fillChecksFromDesignPackage() {
606         NAME_TO_FULL_MODULE_NAME.put("DesignForExtensionCheck",
607                 BASE_PACKAGE + ".checks.design.DesignForExtensionCheck");
608         NAME_TO_FULL_MODULE_NAME.put("FinalClassCheck",
609                 BASE_PACKAGE + ".checks.design.FinalClassCheck");
610         NAME_TO_FULL_MODULE_NAME.put("HideUtilityClassConstructorCheck",
611                 BASE_PACKAGE + ".checks.design.HideUtilityClassConstructorCheck");
612         NAME_TO_FULL_MODULE_NAME.put("InnerTypeLastCheck",
613                 BASE_PACKAGE + ".checks.design.InnerTypeLastCheck");
614         NAME_TO_FULL_MODULE_NAME.put("InterfaceIsTypeCheck",
615                 BASE_PACKAGE + ".checks.design.InterfaceIsTypeCheck");
616         NAME_TO_FULL_MODULE_NAME.put("MutableExceptionCheck",
617                 BASE_PACKAGE + ".checks.design.MutableExceptionCheck");
618         NAME_TO_FULL_MODULE_NAME.put("OneTopLevelClassCheck",
619                 BASE_PACKAGE + ".checks.design.OneTopLevelClassCheck");
620         NAME_TO_FULL_MODULE_NAME.put("ThrowsCountCheck",
621                 BASE_PACKAGE + ".checks.design.ThrowsCountCheck");
622         NAME_TO_FULL_MODULE_NAME.put("VisibilityModifierCheck",
623                 BASE_PACKAGE + ".checks.design.VisibilityModifierCheck");
624     }
625 
626     /**
627      * Fill short-to-full module names map with Checks from header package.
628      */
629     private static void fillChecksFromHeaderPackage() {
630         NAME_TO_FULL_MODULE_NAME.put("HeaderCheck",
631                 BASE_PACKAGE + ".checks.header.HeaderCheck");
632         NAME_TO_FULL_MODULE_NAME.put("RegexpHeaderCheck",
633                 BASE_PACKAGE + ".checks.header.RegexpHeaderCheck");
634     }
635 
636     /**
637      * Fill short-to-full module names map with Checks from imports package.
638      */
639     private static void fillChecksFromImportsPackage() {
640         NAME_TO_FULL_MODULE_NAME.put("AvoidStarImportCheck",
641                 BASE_PACKAGE + ".checks.imports.AvoidStarImportCheck");
642         NAME_TO_FULL_MODULE_NAME.put("AvoidStaticImportCheck",
643                 BASE_PACKAGE + ".checks.imports.AvoidStaticImportCheck");
644         NAME_TO_FULL_MODULE_NAME.put("CustomImportOrderCheck",
645                 BASE_PACKAGE + ".checks.imports.CustomImportOrderCheck");
646         NAME_TO_FULL_MODULE_NAME.put("IllegalImportCheck",
647                 BASE_PACKAGE + ".checks.imports.IllegalImportCheck");
648         NAME_TO_FULL_MODULE_NAME.put("ImportControlCheck",
649                 BASE_PACKAGE + ".checks.imports.ImportControlCheck");
650         NAME_TO_FULL_MODULE_NAME.put("ImportOrderCheck",
651                 BASE_PACKAGE + ".checks.imports.ImportOrderCheck");
652         NAME_TO_FULL_MODULE_NAME.put("RedundantImportCheck",
653                 BASE_PACKAGE + ".checks.imports.RedundantImportCheck");
654         NAME_TO_FULL_MODULE_NAME.put("UnusedImportsCheck",
655                 BASE_PACKAGE + ".checks.imports.UnusedImportsCheck");
656     }
657 
658     /**
659      * Fill short-to-full module names map with Checks from indentation package.
660      */
661     private static void fillChecksFromIndentationPackage() {
662         NAME_TO_FULL_MODULE_NAME.put("CommentsIndentationCheck",
663                 BASE_PACKAGE + ".checks.indentation.CommentsIndentationCheck");
664         NAME_TO_FULL_MODULE_NAME.put("IndentationCheck",
665                 BASE_PACKAGE + ".checks.indentation.IndentationCheck");
666     }
667 
668     /**
669      * Fill short-to-full module names map with Checks from javadoc package.
670      */
671     private static void fillChecksFromJavadocPackage() {
672         NAME_TO_FULL_MODULE_NAME.put("AtclauseOrderCheck",
673                 BASE_PACKAGE + ".checks.javadoc.AtclauseOrderCheck");
674         NAME_TO_FULL_MODULE_NAME.put("InvalidJavadocPositionCheck",
675                 BASE_PACKAGE + ".checks.javadoc.InvalidJavadocPositionCheck");
676         NAME_TO_FULL_MODULE_NAME.put("JavadocBlockTagLocationCheck",
677                 BASE_PACKAGE + ".checks.javadoc.JavadocBlockTagLocationCheck");
678         NAME_TO_FULL_MODULE_NAME.put("JavadocContentLocationCheck",
679                 BASE_PACKAGE + ".checks.javadoc.JavadocContentLocationCheck");
680         NAME_TO_FULL_MODULE_NAME.put("JavadocMethodCheck",
681                 BASE_PACKAGE + ".checks.javadoc.JavadocMethodCheck");
682         NAME_TO_FULL_MODULE_NAME.put("JavadocMissingLeadingAsteriskCheck",
683                 BASE_PACKAGE + ".checks.javadoc.JavadocMissingLeadingAsteriskCheck");
684         NAME_TO_FULL_MODULE_NAME.put("JavadocMissingWhitespaceAfterAsteriskCheck",
685                 BASE_PACKAGE + ".checks.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck");
686         NAME_TO_FULL_MODULE_NAME.put("JavadocPackageCheck",
687                 BASE_PACKAGE + ".checks.javadoc.JavadocPackageCheck");
688         NAME_TO_FULL_MODULE_NAME.put("JavadocParagraphCheck",
689                 BASE_PACKAGE + ".checks.javadoc.JavadocParagraphCheck");
690         NAME_TO_FULL_MODULE_NAME.put("JavadocStyleCheck",
691                 BASE_PACKAGE + ".checks.javadoc.JavadocStyleCheck");
692         NAME_TO_FULL_MODULE_NAME.put("JavadocTagContinuationIndentationCheck",
693                 BASE_PACKAGE + ".checks.javadoc.JavadocTagContinuationIndentationCheck");
694         NAME_TO_FULL_MODULE_NAME.put("JavadocTypeCheck",
695                 BASE_PACKAGE + ".checks.javadoc.JavadocTypeCheck");
696         NAME_TO_FULL_MODULE_NAME.put("JavadocVariableCheck",
697                 BASE_PACKAGE + ".checks.javadoc.JavadocVariableCheck");
698         NAME_TO_FULL_MODULE_NAME.put("MissingJavadocMethodCheck",
699                 BASE_PACKAGE + ".checks.javadoc.MissingJavadocMethodCheck");
700         NAME_TO_FULL_MODULE_NAME.put("MissingJavadocPackageCheck",
701                 BASE_PACKAGE + ".checks.javadoc.MissingJavadocPackageCheck");
702         NAME_TO_FULL_MODULE_NAME.put("MissingJavadocTypeCheck",
703                 BASE_PACKAGE + ".checks.javadoc.MissingJavadocTypeCheck");
704         NAME_TO_FULL_MODULE_NAME.put("NonEmptyAtclauseDescriptionCheck",
705                 BASE_PACKAGE + ".checks.javadoc.NonEmptyAtclauseDescriptionCheck");
706         NAME_TO_FULL_MODULE_NAME.put("RequireEmptyLineBeforeBlockTagGroupCheck",
707                 BASE_PACKAGE + ".checks.javadoc.RequireEmptyLineBeforeBlockTagGroupCheck");
708         NAME_TO_FULL_MODULE_NAME.put("SingleLineJavadocCheck",
709                 BASE_PACKAGE + ".checks.javadoc.SingleLineJavadocCheck");
710         NAME_TO_FULL_MODULE_NAME.put("SummaryJavadocCheck",
711                 BASE_PACKAGE + ".checks.javadoc.SummaryJavadocCheck");
712         NAME_TO_FULL_MODULE_NAME.put("WriteTagCheck",
713                 BASE_PACKAGE + ".checks.javadoc.WriteTagCheck");
714     }
715 
716     /**
717      * Fill short-to-full module names map with Checks from metrics package.
718      */
719     private static void fillChecksFromMetricsPackage() {
720         NAME_TO_FULL_MODULE_NAME.put("BooleanExpressionComplexityCheck",
721                 BASE_PACKAGE + ".checks.metrics.BooleanExpressionComplexityCheck");
722         NAME_TO_FULL_MODULE_NAME.put("ClassDataAbstractionCouplingCheck",
723                 BASE_PACKAGE + ".checks.metrics.ClassDataAbstractionCouplingCheck");
724         NAME_TO_FULL_MODULE_NAME.put("ClassFanOutComplexityCheck",
725                 BASE_PACKAGE + ".checks.metrics.ClassFanOutComplexityCheck");
726         NAME_TO_FULL_MODULE_NAME.put("CyclomaticComplexityCheck",
727                 BASE_PACKAGE + ".checks.metrics.CyclomaticComplexityCheck");
728         NAME_TO_FULL_MODULE_NAME.put("JavaNCSSCheck",
729                 BASE_PACKAGE + ".checks.metrics.JavaNCSSCheck");
730         NAME_TO_FULL_MODULE_NAME.put("NPathComplexityCheck",
731                 BASE_PACKAGE + ".checks.metrics.NPathComplexityCheck");
732     }
733 
734     /**
735      * Fill short-to-full module names map with Checks from modifier package.
736      */
737     private static void fillChecksFromModifierPackage() {
738         NAME_TO_FULL_MODULE_NAME.put("ClassMemberImpliedModifierCheck",
739             BASE_PACKAGE + ".checks.modifier.ClassMemberImpliedModifierCheck");
740         NAME_TO_FULL_MODULE_NAME.put("InterfaceMemberImpliedModifierCheck",
741             BASE_PACKAGE + ".checks.modifier.InterfaceMemberImpliedModifierCheck");
742         NAME_TO_FULL_MODULE_NAME.put("ModifierOrderCheck",
743                 BASE_PACKAGE + ".checks.modifier.ModifierOrderCheck");
744         NAME_TO_FULL_MODULE_NAME.put("RedundantModifierCheck",
745                 BASE_PACKAGE + ".checks.modifier.RedundantModifierCheck");
746     }
747 
748     /**
749      * Fill short-to-full module names map with Checks from naming package.
750      */
751     private static void fillChecksFromNamingPackage() {
752         NAME_TO_FULL_MODULE_NAME.put("AbbreviationAsWordInNameCheck",
753                 BASE_PACKAGE + ".checks.naming.AbbreviationAsWordInNameCheck");
754         NAME_TO_FULL_MODULE_NAME.put("AbstractClassNameCheck",
755                 BASE_PACKAGE + ".checks.naming.AbstractClassNameCheck");
756         NAME_TO_FULL_MODULE_NAME.put("CatchParameterNameCheck",
757                 BASE_PACKAGE + ".checks.naming.CatchParameterNameCheck");
758         NAME_TO_FULL_MODULE_NAME.put("ClassTypeParameterNameCheck",
759                 BASE_PACKAGE + ".checks.naming.ClassTypeParameterNameCheck");
760         NAME_TO_FULL_MODULE_NAME.put("ConstantNameCheck",
761                 BASE_PACKAGE + ".checks.naming.ConstantNameCheck");
762         NAME_TO_FULL_MODULE_NAME.put("InterfaceTypeParameterNameCheck",
763                 BASE_PACKAGE + ".checks.naming.InterfaceTypeParameterNameCheck");
764         NAME_TO_FULL_MODULE_NAME.put("LambdaParameterNameCheck",
765                 BASE_PACKAGE + ".checks.naming.LambdaParameterNameCheck");
766         NAME_TO_FULL_MODULE_NAME.put("LocalFinalVariableNameCheck",
767                 BASE_PACKAGE + ".checks.naming.LocalFinalVariableNameCheck");
768         NAME_TO_FULL_MODULE_NAME.put("LocalVariableNameCheck",
769                 BASE_PACKAGE + ".checks.naming.LocalVariableNameCheck");
770         NAME_TO_FULL_MODULE_NAME.put("MemberNameCheck",
771                 BASE_PACKAGE + ".checks.naming.MemberNameCheck");
772         NAME_TO_FULL_MODULE_NAME.put("MethodNameCheck",
773                 BASE_PACKAGE + ".checks.naming.MethodNameCheck");
774         NAME_TO_FULL_MODULE_NAME.put("MethodTypeParameterNameCheck",
775                 BASE_PACKAGE + ".checks.naming.MethodTypeParameterNameCheck");
776         NAME_TO_FULL_MODULE_NAME.put("PackageNameCheck",
777                 BASE_PACKAGE + ".checks.naming.PackageNameCheck");
778         NAME_TO_FULL_MODULE_NAME.put("ParameterNameCheck",
779                 BASE_PACKAGE + ".checks.naming.ParameterNameCheck");
780         NAME_TO_FULL_MODULE_NAME.put("RecordComponentNameCheck",
781                 BASE_PACKAGE + ".checks.naming.RecordComponentNameCheck");
782         NAME_TO_FULL_MODULE_NAME.put("RecordTypeParameterNameCheck",
783                 BASE_PACKAGE + ".checks.naming.RecordTypeParameterNameCheck");
784         NAME_TO_FULL_MODULE_NAME.put("StaticVariableNameCheck",
785                 BASE_PACKAGE + ".checks.naming.StaticVariableNameCheck");
786         NAME_TO_FULL_MODULE_NAME.put("TypeNameCheck",
787                 BASE_PACKAGE + ".checks.naming.TypeNameCheck");
788         NAME_TO_FULL_MODULE_NAME.put("PatternVariableNameCheck",
789                 BASE_PACKAGE + ".checks.naming.PatternVariableNameCheck");
790         NAME_TO_FULL_MODULE_NAME.put("IllegalIdentifierNameCheck",
791             BASE_PACKAGE + ".checks.naming.IllegalIdentifierNameCheck");
792     }
793 
794     /**
795      * Fill short-to-full module names map with Checks from regexp package.
796      */
797     private static void fillChecksFromRegexpPackage() {
798         NAME_TO_FULL_MODULE_NAME.put("RegexpCheck",
799                 BASE_PACKAGE + ".checks.regexp.RegexpCheck");
800         NAME_TO_FULL_MODULE_NAME.put("RegexpMultilineCheck",
801                 BASE_PACKAGE + ".checks.regexp.RegexpMultilineCheck");
802         NAME_TO_FULL_MODULE_NAME.put("RegexpOnFilenameCheck",
803                 BASE_PACKAGE + ".checks.regexp.RegexpOnFilenameCheck");
804         NAME_TO_FULL_MODULE_NAME.put("RegexpSinglelineCheck",
805                 BASE_PACKAGE + ".checks.regexp.RegexpSinglelineCheck");
806         NAME_TO_FULL_MODULE_NAME.put("RegexpSinglelineJavaCheck",
807                 BASE_PACKAGE + ".checks.regexp.RegexpSinglelineJavaCheck");
808     }
809 
810     /**
811      * Fill short-to-full module names map with Checks from sizes package.
812      */
813     private static void fillChecksFromSizesPackage() {
814         NAME_TO_FULL_MODULE_NAME.put("AnonInnerLengthCheck",
815                 BASE_PACKAGE + ".checks.sizes.AnonInnerLengthCheck");
816         NAME_TO_FULL_MODULE_NAME.put("ExecutableStatementCountCheck",
817                 BASE_PACKAGE + ".checks.sizes.ExecutableStatementCountCheck");
818         NAME_TO_FULL_MODULE_NAME.put("FileLengthCheck",
819                 BASE_PACKAGE + ".checks.sizes.FileLengthCheck");
820         NAME_TO_FULL_MODULE_NAME.put("LambdaBodyLengthCheck",
821                 BASE_PACKAGE + ".checks.sizes.LambdaBodyLengthCheck");
822         NAME_TO_FULL_MODULE_NAME.put("LineLengthCheck",
823                 BASE_PACKAGE + ".checks.sizes.LineLengthCheck");
824         NAME_TO_FULL_MODULE_NAME.put("MethodCountCheck",
825                 BASE_PACKAGE + ".checks.sizes.MethodCountCheck");
826         NAME_TO_FULL_MODULE_NAME.put("MethodLengthCheck",
827                 BASE_PACKAGE + ".checks.sizes.MethodLengthCheck");
828         NAME_TO_FULL_MODULE_NAME.put("OuterTypeNumberCheck",
829                 BASE_PACKAGE + ".checks.sizes.OuterTypeNumberCheck");
830         NAME_TO_FULL_MODULE_NAME.put("ParameterNumberCheck",
831                 BASE_PACKAGE + ".checks.sizes.ParameterNumberCheck");
832         NAME_TO_FULL_MODULE_NAME.put("RecordComponentNumberCheck",
833                 BASE_PACKAGE + ".checks.sizes.RecordComponentNumberCheck");
834     }
835 
836     /**
837      * Fill short-to-full module names map with Checks from whitespace package.
838      */
839     private static void fillChecksFromWhitespacePackage() {
840         NAME_TO_FULL_MODULE_NAME.put("EmptyForInitializerPadCheck",
841                 BASE_PACKAGE + ".checks.whitespace.EmptyForInitializerPadCheck");
842         NAME_TO_FULL_MODULE_NAME.put("EmptyForIteratorPadCheck",
843                 BASE_PACKAGE + ".checks.whitespace.EmptyForIteratorPadCheck");
844         NAME_TO_FULL_MODULE_NAME.put("EmptyLineSeparatorCheck",
845                 BASE_PACKAGE + ".checks.whitespace.EmptyLineSeparatorCheck");
846         NAME_TO_FULL_MODULE_NAME.put("FileTabCharacterCheck",
847                 BASE_PACKAGE + ".checks.whitespace.FileTabCharacterCheck");
848         NAME_TO_FULL_MODULE_NAME.put("GenericWhitespaceCheck",
849                 BASE_PACKAGE + ".checks.whitespace.GenericWhitespaceCheck");
850         NAME_TO_FULL_MODULE_NAME.put("MethodParamPadCheck",
851                 BASE_PACKAGE + ".checks.whitespace.MethodParamPadCheck");
852         NAME_TO_FULL_MODULE_NAME.put("NoLineWrapCheck",
853                 BASE_PACKAGE + ".checks.whitespace.NoLineWrapCheck");
854         NAME_TO_FULL_MODULE_NAME.put("NoWhitespaceAfterCheck",
855                 BASE_PACKAGE + ".checks.whitespace.NoWhitespaceAfterCheck");
856         NAME_TO_FULL_MODULE_NAME.put("NoWhitespaceBeforeCheck",
857                 BASE_PACKAGE + ".checks.whitespace.NoWhitespaceBeforeCheck");
858         NAME_TO_FULL_MODULE_NAME.put("NoWhitespaceBeforeCaseDefaultColonCheck",
859                 BASE_PACKAGE + ".checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck");
860         NAME_TO_FULL_MODULE_NAME.put("OperatorWrapCheck",
861                 BASE_PACKAGE + ".checks.whitespace.OperatorWrapCheck");
862         NAME_TO_FULL_MODULE_NAME.put("ParenPadCheck",
863                 BASE_PACKAGE + ".checks.whitespace.ParenPadCheck");
864         NAME_TO_FULL_MODULE_NAME.put("SeparatorWrapCheck",
865                 BASE_PACKAGE + ".checks.whitespace.SeparatorWrapCheck");
866         NAME_TO_FULL_MODULE_NAME.put("SingleSpaceSeparatorCheck",
867                 BASE_PACKAGE + ".checks.whitespace.SingleSpaceSeparatorCheck");
868         NAME_TO_FULL_MODULE_NAME.put("TypecastParenPadCheck",
869                 BASE_PACKAGE + ".checks.whitespace.TypecastParenPadCheck");
870         NAME_TO_FULL_MODULE_NAME.put("WhitespaceAfterCheck",
871                 BASE_PACKAGE + ".checks.whitespace.WhitespaceAfterCheck");
872         NAME_TO_FULL_MODULE_NAME.put("WhitespaceAroundCheck",
873                 BASE_PACKAGE + ".checks.whitespace.WhitespaceAroundCheck");
874     }
875 
876     /**
877      * Fill short-to-full module names map with modules from checks package.
878      */
879     private static void fillModulesFromChecksPackage() {
880         NAME_TO_FULL_MODULE_NAME.put("ArrayTypeStyleCheck",
881                 BASE_PACKAGE + ".checks.ArrayTypeStyleCheck");
882         NAME_TO_FULL_MODULE_NAME.put("AvoidEscapedUnicodeCharactersCheck",
883                 BASE_PACKAGE + ".checks.AvoidEscapedUnicodeCharactersCheck");
884         NAME_TO_FULL_MODULE_NAME.put("DescendantTokenCheck",
885                 BASE_PACKAGE + ".checks.DescendantTokenCheck");
886         NAME_TO_FULL_MODULE_NAME.put("FinalParametersCheck",
887                 BASE_PACKAGE + ".checks.FinalParametersCheck");
888         NAME_TO_FULL_MODULE_NAME.put("NewlineAtEndOfFileCheck",
889                 BASE_PACKAGE + ".checks.NewlineAtEndOfFileCheck");
890         NAME_TO_FULL_MODULE_NAME.put("NoCodeInFileCheck",
891                 BASE_PACKAGE + ".checks.NoCodeInFileCheck");
892         NAME_TO_FULL_MODULE_NAME.put("OuterTypeFilenameCheck",
893                 BASE_PACKAGE + ".checks.OuterTypeFilenameCheck");
894         NAME_TO_FULL_MODULE_NAME.put("OrderedPropertiesCheck",
895                 BASE_PACKAGE + ".checks.OrderedPropertiesCheck");
896         NAME_TO_FULL_MODULE_NAME.put("SuppressWarningsHolder",
897                 BASE_PACKAGE + ".checks.SuppressWarningsHolder");
898         NAME_TO_FULL_MODULE_NAME.put("TodoCommentCheck",
899                 BASE_PACKAGE + ".checks.TodoCommentCheck");
900         NAME_TO_FULL_MODULE_NAME.put("TrailingCommentCheck",
901                 BASE_PACKAGE + ".checks.TrailingCommentCheck");
902         NAME_TO_FULL_MODULE_NAME.put("TranslationCheck",
903                 BASE_PACKAGE + ".checks.TranslationCheck");
904         NAME_TO_FULL_MODULE_NAME.put("UncommentedMainCheck",
905                 BASE_PACKAGE + ".checks.UncommentedMainCheck");
906         NAME_TO_FULL_MODULE_NAME.put("UniquePropertiesCheck",
907                 BASE_PACKAGE + ".checks.UniquePropertiesCheck");
908         NAME_TO_FULL_MODULE_NAME.put("UpperEllCheck",
909                 BASE_PACKAGE + ".checks.UpperEllCheck");
910     }
911 
912     /**
913      * Fill short-to-full module names map with modules from filefilters package.
914      */
915     private static void fillModulesFromFilefiltersPackage() {
916         NAME_TO_FULL_MODULE_NAME.put("BeforeExecutionExclusionFileFilter",
917                 BASE_PACKAGE + ".filefilters.BeforeExecutionExclusionFileFilter");
918     }
919 
920     /**
921      * Fill short-to-full module names map with modules from filters package.
922      */
923     private static void fillModulesFromFiltersPackage() {
924         NAME_TO_FULL_MODULE_NAME.put("SeverityMatchFilter",
925                 BASE_PACKAGE + ".filters.SeverityMatchFilter");
926         NAME_TO_FULL_MODULE_NAME.put("SuppressWithPlainTextCommentFilter",
927             BASE_PACKAGE + ".filters.SuppressWithPlainTextCommentFilter");
928         NAME_TO_FULL_MODULE_NAME.put("SuppressionCommentFilter",
929                 BASE_PACKAGE + ".filters.SuppressionCommentFilter");
930         NAME_TO_FULL_MODULE_NAME.put("SuppressionFilter",
931                 BASE_PACKAGE + ".filters.SuppressionFilter");
932         NAME_TO_FULL_MODULE_NAME.put("SuppressionSingleFilter",
933                 BASE_PACKAGE + ".filters.SuppressionSingleFilter");
934         NAME_TO_FULL_MODULE_NAME.put("SuppressionXpathFilter",
935                 BASE_PACKAGE + ".filters.SuppressionXpathFilter");
936         NAME_TO_FULL_MODULE_NAME.put("SuppressionXpathSingleFilter",
937                 BASE_PACKAGE + ".filters.SuppressionXpathSingleFilter");
938         NAME_TO_FULL_MODULE_NAME.put("SuppressWarningsFilter",
939                 BASE_PACKAGE + ".filters.SuppressWarningsFilter");
940         NAME_TO_FULL_MODULE_NAME.put("SuppressWithNearbyCommentFilter",
941                 BASE_PACKAGE + ".filters.SuppressWithNearbyCommentFilter");
942         NAME_TO_FULL_MODULE_NAME.put("SuppressWithNearbyTextFilter",
943                 BASE_PACKAGE + ".filters.SuppressWithNearbyTextFilter");
944     }
945 
946     /**
947      * Fill short-to-full module names map with modules from checkstyle package.
948      */
949     private static void fillModulesFromCheckstylePackage() {
950         NAME_TO_FULL_MODULE_NAME.put("Checker", BASE_PACKAGE + ".Checker");
951         NAME_TO_FULL_MODULE_NAME.put("TreeWalker", BASE_PACKAGE + ".TreeWalker");
952     }
953 
954 }