Class CompositeRule

  • All Implemented Interfaces:
    TransformerRule

    public class CompositeRule
    extends java.lang.Object
    implements TransformerRule
    Aggregate of rules to be used in NodeTransformer when multiple rules per operation required. Rules are checked in sequential order.
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeRule​(java.util.List<? extends TransformerRule> rules)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Node apply​(Node node)
      Apply the rule to given node (when applicable).
      boolean isApplicable​(Node node)
      Test for the rule can be applied to given node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompositeRule

        public CompositeRule​(java.util.List<? extends TransformerRule> rules)
        Default constructor.
        Parameters:
        rules - The rules to be composed.
    • Method Detail

      • isApplicable

        public boolean isApplicable​(Node node)
        Description copied from interface: TransformerRule
        Test for the rule can be applied to given node.
        Specified by:
        isApplicable in interface TransformerRule
        Parameters:
        node - Expression node to check applicability for.
        Returns:
        true if the rule is applicable to given node.
      • apply

        public Node apply​(Node node)
        Description copied from interface: TransformerRule
        Apply the rule to given node (when applicable).
        Specified by:
        apply in interface TransformerRule
        Parameters:
        node - Expression node the rule will be applied to.
        Returns:
        Node substitution expression.