Class ModuleReflectionUtil

    • Method Detail

      • isCheckstyleModule

        public static boolean isCheckstyleModule​(Class<?> clazz)
        Checks whether a class may be considered as a checkstyle module. Checkstyle's modules are non-abstract classes, which are either checkstyle's checks, file sets, filters, file filters, TreeWalker filters, audit listener, or root module.
        Parameters:
        clazz - class to check.
        Returns:
        true if the class may be considered as the checkstyle module.
      • isValidCheckstyleClass

        public static boolean isValidCheckstyleClass​(Class<?> clazz)
        Checks whether a class extends 'AutomaticBean', is non-abstract, and has a default constructor.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered a valid production class.
      • hasDefaultConstructor

        private static boolean hasDefaultConstructor​(Class<?> clazz)
        Checks if the class has a default constructor.
        Parameters:
        clazz - class to check
        Returns:
        true if the class has a default constructor.
      • isCheckstyleTreeWalkerCheck

        public static boolean isCheckstyleTreeWalkerCheck​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle check which has TreeWalker as a parent. Checkstyle's checks are classes which implement 'AbstractCheck' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle check.
      • isFileSetModule

        public static boolean isFileSetModule​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle file set. Checkstyle's file sets are classes which implement 'AbstractFileSetCheck' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle file set.
      • isFilterModule

        public static boolean isFilterModule​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle filter. Checkstyle's filters are classes which implement 'Filter' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle filter.
      • isFileFilterModule

        public static boolean isFileFilterModule​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle file filter. Checkstyle's file filters are classes which implement 'BeforeExecutionFileFilter' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle file filter.
      • isAuditListener

        public static boolean isAuditListener​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle audit listener module. Checkstyle's audit listener modules are classes which implement 'AuditListener' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle audit listener module.
      • isRootModule

        public static boolean isRootModule​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle root module. Checkstyle's root modules are classes which implement 'RootModule' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle root module.
      • isTreeWalkerFilterModule

        public static boolean isTreeWalkerFilterModule​(Class<?> clazz)
        Checks whether a class may be considered as the checkstyle TreeWalker filter. Checkstyle's TreeWalker filters are classes which implement 'TreeWalkerFilter' interface.
        Parameters:
        clazz - class to check.
        Returns:
        true if a class may be considered as the checkstyle TreeWalker filter.
      • isNotXpathFileGenerator

        private static boolean isNotXpathFileGenerator​(Class<?> clazz)
        Checks whether a class is XpathFileGeneratorAstFilter or XpathFileGeneratorAuditListener. See issue #102 https://github.com/checkstyle/checkstyle/issues/102
        Parameters:
        clazz - class to check.
        Returns:
        true if a class name starts with `XpathFileGenerator`.