Class OptimizeTreeStructure
java.lang.Object
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.TreeTransformer
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.OptimizeTreeStructure
Cleans up a loaded
Tree by merging non-wildcard siblings into an existing wildcard node,
adding a synthetic value field under childless wildcard nodes, and marking JSON array elements
as record breaks.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddRecordBreakOnArray(TreeNode child) Marks the node as a record break if its parent is a JSON array.protected voidGives a childless, non-array wildcard node a child field, suffixed_value, that reads the node's text.protected voidClears the record-break flag of each only child below the parent, recursively; not called bytransform(Tree).protected voidmergeWildcardSiblings(TreeNode parent) Merges every other child of the parent into its first wildcard child, if it has one.voidRuns this pass over the loaded tree, updating its nodes in place.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.tree.detect.TreeTransformer
merge, mergeChildren
-
Constructor Details
-
OptimizeTreeStructure
public OptimizeTreeStructure()
-
-
Method Details
-
transform
Description copied from class:TreeTransformerRuns this pass over the loaded tree, updating its nodes in place.- Specified by:
transformin classTreeTransformer
-
mergeWildcardSiblings
Merges every other child of the parent into its first wildcard child, if it has one. -
ensureSoloDescendantsAreNotRecordBreaks
Clears the record-break flag of each only child below the parent, recursively; not called bytransform(Tree). -
addSingleValueWildcardChildField
Gives a childless, non-array wildcard node a child field, suffixed_value, that reads the node's text. -
addRecordBreakOnArray
Marks the node as a record break if its parent is a JSON array.
-