public class CollapseSiblingPatterns extends TreeTransformer
SiblingSetRule) into a single wildcard node, mirroring what the build-time
NodeNameRules produce for individually dynamic names: the collapsed node is named
*, its XPath expression ends in node(), member names become its values,
and descendant XPaths collapse the merged segment to *.
Opt-in — insert it before the detection passes with
TreeDetectionStrategy.enableSiblingPatternCollapse(), ideally together with
standard(true) so wildcard post-processing
(leftover-sibling merging and synthetic value fields for childless nodes) applies to the
collapsed node too. One pattern is collapsed per parent: rules are consulted in order and the
first rule to derive a pattern wins, so rule order sets precedence (within
AffixSiblingSetRule, competing name buckets are tried largest first).
| Constructor and Description |
|---|
CollapseSiblingPatterns() |
| Modifier and Type | Method and Description |
|---|---|
CollapseSiblingPatterns |
addRule(SiblingSetRule rule) |
CollapseSiblingPatterns |
clearRules() |
protected void |
collapseChildren(TreeNode parent) |
protected List<TreeNode> |
getCandidateSiblings(TreeNode parent)
Returns the children eligible for pattern derivation: named element/field nodes, excluding
attributes, existing wildcards, JSON container nodes, and nodes without an XPath expression.
|
List<SiblingSetRule> |
getRules() |
void |
transform(Tree tree) |
merge, mergeChildrenpublic List<SiblingSetRule> getRules()
public CollapseSiblingPatterns addRule(SiblingSetRule rule)
public CollapseSiblingPatterns clearRules()
public void transform(Tree tree)
transform in class TreeTransformerprotected void collapseChildren(TreeNode parent)
Copyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.