java.lang.Object
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.TreeTransformer
Direct Known Subclasses:
CollapseSiblingPatterns, DetectFieldCandidates, DetectRecordBreakCandidates, MakeFieldNamesUnique, OptimizeTreeStructure

public abstract class TreeTransformer extends Object
A single pass in a TreeDetectionStrategy that analyzes or restructures a Tree after it has been loaded from an XML or JSON document.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    merge(TreeNode sourceTreeNode, TreeNode targetTreeNode)
    Folds the source node into the target (adding its instance count, combining the record-break, field and cascade flags and merging its children), then removes the source from its parent.
    protected void
    mergeChildren(TreeNode sourceParent, TreeNode targetParent)
    Merges each child of the source into the target's child of the same name, or moves it under the target and rewrites the XPath expressions in its subtree to the target's path.
    abstract void
    Runs this pass over the loaded tree, updating its nodes in place.

    Methods inherited from class java.lang.Object

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

    • TreeTransformer

      public TreeTransformer()
  • Method Details

    • transform

      public abstract void transform(Tree tree)
      Runs this pass over the loaded tree, updating its nodes in place.
    • merge

      protected void merge(TreeNode sourceTreeNode, TreeNode targetTreeNode)
      Folds the source node into the target (adding its instance count, combining the record-break, field and cascade flags and merging its children), then removes the source from its parent.
    • mergeChildren

      protected void mergeChildren(TreeNode sourceParent, TreeNode targetParent)
      Merges each child of the source into the target's child of the same name, or moves it under the target and rewrites the XPath expressions in its subtree to the target's path.