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

public class DateTimeNodeNameRule extends Object implements NodeNameRule
Classifies date/timestamp names (for example 2024-01-15 map keys) as dynamic using a DateTimePatternDetector. Opt-in — not part of the standard rule set; enable it with TreeDetectionStrategy.enableDateTimeNodeNames().

Classification runs once per parse event, so results are memoized in a bounded, access-ordered cache and names longer than maximumNameLength are rejected without parsing.

  • Field Details

    • DEFAULT_MAXIMUM_NAME_LENGTH

      public static final int DEFAULT_MAXIMUM_NAME_LENGTH
      See Also:
  • Constructor Details

    • DateTimeNodeNameRule

      public DateTimeNodeNameRule()
  • Method Details

    • 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
    • getDateTimePatternDetector

      public DateTimePatternDetector getDateTimePatternDetector()
      Returns the detector used to recognize date/time names.
    • setDateTimePatternDetector

      public DateTimeNodeNameRule setDateTimePatternDetector(DateTimePatternDetector dateTimePatternDetector)
      Sets the detector used to recognize date/time names (null restores the default) and clears the cached results.
    • getMaximumNameLength

      public int getMaximumNameLength()
      Returns the longest name this rule will attempt to parse as a date/timestamp (default 40).
    • setMaximumNameLength

      public DateTimeNodeNameRule setMaximumNameLength(int maximumNameLength)
      Sets the longest name this rule will attempt to parse as a date/timestamp (default 40) and clears the cached results.