Class RulesetsFactoryUtils


  • public final class RulesetsFactoryUtils
    extends Object
    • Method Detail

      • getRuleSets

        @InternalApi
        @Deprecated
        public static RuleSets getRuleSets​(String rulesets,
                                           RuleSetFactory factory)
        Deprecated.
        Internal API
        Creates a new rulesets with the given string. The resulting rulesets will contain all referenced rulesets.
        Parameters:
        rulesets - the string with the rulesets to load
        factory - the ruleset factory
        Returns:
        the rulesets
        Throws:
        IllegalArgumentException - if rulesets is empty (means, no rules have been found) or if a ruleset couldn't be found.
      • createFactory

        public static RuleSetFactory createFactory​(PMDConfiguration configuration,
                                                   ClassLoader classLoader)
        Returns a ruleset factory which uses the provided ClassLoader to resolve resource references. It warns for deprecated rule usages.
        Parameters:
        configuration - PMD configuration, contains info about the factory parameters
        classLoader - Class loader to load resources
        Returns:
        A ruleset factory
        See Also:
        createFactory(PMDConfiguration)
      • createFactory

        public static RuleSetFactory createFactory​(ClassLoader classLoader,
                                                   RulePriority minimumPriority,
                                                   boolean warnDeprecated,
                                                   boolean enableCompatibility)
        Returns a ruleset factory which uses the provided ClassLoader to resolve resource references.
        Parameters:
        minimumPriority - Minimum priority for rules to be included
        warnDeprecated - If true, print warnings when deprecated rules are included
        enableCompatibility - If true, rule references to moved rules are mapped to their new location if they are known
        classLoader - Class loader to load resources
        Returns:
        A ruleset factory
        See Also:
        createFactory(PMDConfiguration)
      • createFactory

        public static RuleSetFactory createFactory​(RulePriority minimumPriority,
                                                   boolean warnDeprecated,
                                                   boolean enableCompatibility)
        Returns a ruleset factory which uses the classloader for PMD classes to resolve resource references.
        Parameters:
        minimumPriority - Minimum priority for rules to be included
        warnDeprecated - If true, print warnings when deprecated rules are included
        enableCompatibility - If true, rule references to moved rules are mapped to their new location if they are known
        Returns:
        A ruleset factory
        See Also:
        createFactory(PMDConfiguration)