Package net.sourceforge.pmd.rules
Class RuleFactory
- java.lang.Object
-
- net.sourceforge.pmd.rules.RuleFactory
-
@InternalApi @Deprecated public class RuleFactory extends Object
Deprecated.Builds rules from rule XML nodes.- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Constructor Summary
Constructors Constructor Description RuleFactory(ResourceLoader resourceLoader, LanguageRegistry languageRegistry)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Rule
buildRule(Element ruleElement, PmdXmlReporter err)
Deprecated.Parses a rule element and returns a new rule instance.RuleReference
decorateRule(Rule referencedRule, RuleSetReference ruleSetReference, Element ruleElement, PmdXmlReporter err)
Deprecated.Decorates a referenced rule with the metadata that are overridden in the given rule element.static @Nullable RulePriority
parsePriority(PmdXmlReporter err, Element node)
Deprecated.Parse a priority.
-
-
-
Constructor Detail
-
RuleFactory
public RuleFactory(ResourceLoader resourceLoader, LanguageRegistry languageRegistry)
Deprecated.- Parameters:
resourceLoader
- The resource loader to load the rule from jar
-
-
Method Detail
-
decorateRule
public RuleReference decorateRule(Rule referencedRule, RuleSetReference ruleSetReference, Element ruleElement, PmdXmlReporter err)
Deprecated.Decorates a referenced rule with the metadata that are overridden in the given rule element.Declaring a property in the overriding element throws an exception (the property must exist in the referenced rule).
- Parameters:
referencedRule
- Referenced ruleruleSetReference
- the ruleset, where the referenced rule is definedruleElement
- Element overriding some metadata about the ruleerr
- Error reporter- Returns:
- A rule reference to the referenced rule
-
buildRule
public Rule buildRule(Element ruleElement, PmdXmlReporter err)
Deprecated.Parses a rule element and returns a new rule instance.Notes: The ruleset name is not set here. Exceptions raised from this method indicate invalid XML structure, with regards to the expected schema, while RuleBuilder validates the semantics.
- Parameters:
ruleElement
- The rule element to parse- Returns:
- A new instance of the rule described by this element
- Throws:
IllegalArgumentException
- if the element doesn't describe a valid rule.
-
parsePriority
public static @Nullable RulePriority parsePriority(PmdXmlReporter err, Element node)
Deprecated.Parse a priority. If invalid, report it and return null.
-
-