Class RuleFactory


  • @InternalApi
    @Deprecated
    public class RuleFactory
    extends Object
    Deprecated.
    Builds rules from rule XML nodes.
    Since:
    6.0.0
    Author:
    Clément Fournier
    • 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 rule
        ruleSetReference - the ruleset, where the referenced rule is defined
        ruleElement - 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.