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()
Deprecated.UseRuleFactory(ResourceLoader)
instead.RuleFactory(ResourceLoader resourceLoader)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Rule
buildRule(Element ruleElement)
Deprecated.Parses a rule element and returns a new rule instance.RuleReference
decorateRule(Rule referencedRule, RuleSetReference ruleSetReference, Element ruleElement)
Deprecated.Decorates a referenced rule with the metadata that are overridden in the given rule element.
-
-
-
Constructor Detail
-
RuleFactory
@Deprecated public RuleFactory()
Deprecated.UseRuleFactory(ResourceLoader)
instead.
-
RuleFactory
public RuleFactory(ResourceLoader resourceLoader)
Deprecated.- Parameters:
resourceLoader
- The resource loader to load the rule from jar
-
-
Method Detail
-
decorateRule
public RuleReference decorateRule(Rule referencedRule, RuleSetReference ruleSetReference, Element ruleElement)
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 rule- Returns:
- A rule reference to the referenced rule
-
buildRule
public Rule buildRule(Element ruleElement)
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.
-
-