Class RulesetsFactoryUtils

    • 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.
      • defaultFactory

        public static RuleSetFactory defaultFactory()
        Deprecated.
        Returns a ruleset factory with default parameters. It doesn't prune rules based on priority, and doesn't warn for deprecations.
        Returns:
        A ruleset factory
        See Also:
        RuleSetLoader
      • createFactory

        @Deprecated
        public static RuleSetFactory createFactory​(ClassLoader classLoader,
                                                   RulePriority minimumPriority,
                                                   boolean warnDeprecated,
                                                   boolean enableCompatibility)
        Deprecated.
        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

        @Deprecated
        public static RuleSetFactory createFactory​(RulePriority minimumPriority,
                                                   boolean warnDeprecated,
                                                   boolean enableCompatibility)
        Deprecated.
        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)
      • createFactory

        @Deprecated
        public static RuleSetFactory createFactory​(RulePriority minimumPriority,
                                                   boolean warnDeprecated,
                                                   boolean enableCompatibility,
                                                   boolean includeDeprecatedRuleReferences)
        Deprecated.
        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
        includeDeprecatedRuleReferences - If true, deprecated rule references are retained. Usually, these references are ignored, since they indicate renamed/moved rules, and the referenced rule is often included in the same ruleset. Enabling this might result in duplicated rules.
        Returns:
        A ruleset factory
        See Also:
        createFactory(PMDConfiguration)