java.lang.Object
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.RegexNodeNameRule
All Implemented Interfaces:
NodeNameRule

public class RegexNodeNameRule extends Object implements NodeNameRule
Classifies names matching a caller-supplied regular expression as dynamic. The expression must match the whole name (row\d+ matches row12 but not xrow12).

Use it as a build-time rule so matching names collapse to wildcard nodes while the tree loads:

 Tree.loadXml(file, TreeDetectionStrategy.standard(true).addNodeNameRule(new RegexNodeNameRule("row\\d+")));
 

or as an affix segment rule so sibling middles the standard rules do not recognize (for example 3A, 5B) can still derive a collapse pattern.

  • Constructor Details

    • RegexNodeNameRule

      public RegexNodeNameRule(String pattern)
  • Method Details

    • getPattern

      public String getPattern()
    • isDynamicName

      public boolean isDynamicName(String nodeName)
      Description copied from interface: NodeNameRule
      Returns true if the name is dynamic data, such as an identifier or date, rather than a fixed structural name.
      Specified by:
      isDynamicName in interface NodeNameRule
    • toString

      public String toString()
      Overrides:
      toString in class Object