Class AffixSiblingSetRule
java.lang.Object
com.northconcepts.datapipeline.foundations.pipeline.tree.detect.AffixSiblingSetRule
- All Implemented Interfaces:
SiblingSetRule
Derives a
SiblingSetPattern from siblings sharing a fixed prefix/suffix around a varying
dynamic segment — for example item-1, item-2, item-3
collapse to item-*.
Sibling names are first bucketed by their leading text up to the first separator run
(-, _, ., space). Within each large-enough bucket, the
longest common prefix and suffix are backed off to successively shorter separator (and
letter-to-digit) boundaries — shortest first, favoring the most general pattern — until every
middle segment is non-empty and classified as dynamic by a single segment
rule (default: StandardNodeNameRule; add a DateTimeNodeNameRule to derive
patterns like report-* from report-2024-01-15,
report-2024-01-16). Patterns whose affixes are empty after trimming separators are
rejected — entirely dynamic names are the build-time rules' job.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSegmentRule(NodeNameRule segmentRule) Adds a rule for classifying middle segments; all the middle segments of a pattern must satisfy the same rule.Removes all segment rules, including the defaultStandardNodeNameRule.derivePattern(TreeNode parent, List<TreeNode> candidateSiblings) Returns the pattern shared by the candidate children ofparent, or null;CollapseSiblingPatternspasses its named children, excluding attributes, wildcards and JSON containers.intReturns the minimum number of pattern-sharing siblings required to derive a pattern (default 3).Returns the editable list of rules, tried in order, that classify the varying middle segment of sibling names.setMinimumSiblings(int minimumSiblings) Sets the minimum number of pattern-sharing siblings required to derive a pattern (default 3, at least 2).
-
Field Details
-
DEFAULT_MINIMUM_SIBLINGS
public static final int DEFAULT_MINIMUM_SIBLINGS- See Also:
-
-
Constructor Details
-
AffixSiblingSetRule
public AffixSiblingSetRule()Creates a rule that classifies middle segments with aStandardNodeNameRule.
-
-
Method Details
-
getMinimumSiblings
public int getMinimumSiblings()Returns the minimum number of pattern-sharing siblings required to derive a pattern (default 3). -
setMinimumSiblings
Sets the minimum number of pattern-sharing siblings required to derive a pattern (default 3, at least 2). -
getSegmentRules
Returns the editable list of rules, tried in order, that classify the varying middle segment of sibling names. -
addSegmentRule
Adds a rule for classifying middle segments; all the middle segments of a pattern must satisfy the same rule. -
clearSegmentRules
Removes all segment rules, including the defaultStandardNodeNameRule. -
derivePattern
Description copied from interface:SiblingSetRuleReturns the pattern shared by the candidate children ofparent, or null;CollapseSiblingPatternspasses its named children, excluding attributes, wildcards and JSON containers.- Specified by:
derivePatternin interfaceSiblingSetRule
-