Class StampRegistry

java.lang.Object
network.ike.docs.plugin.diff.StampRegistry

public final class StampRegistry extends Object
The packet's stamp set (ike-issues#656): one STAMP per (range commit, status) pair, plus the uncommitted pair for working-tree marks. Emits reusable AsciiDoc footnotes — every emission carries the full text, so document order never matters; Asciidoctor reuses the first definition per id — and accumulates the used stamps for the packet's Stamp Register table.

Status is stated redundantly in the endnote for STAMP consistency: Active for insertions and replacements (a replacement is a new Active version; its predecessor is covered by the successor's stamp), Inactive for unpaired deletions. The remaining coordinates map to the git era as: Time = author date, Author = commit author, Module = the topic's domain, Path = the branch.

  • Constructor Details

    • StampRegistry

      public StampRegistry(List<GitSource.CommitMeta> rangeCommits, String branch, String worktreeAuthor, String renderDate, String rangeLabel)
      Create the registry for one packet.
      Parameters:
      rangeCommits - the compared range's commits
      branch - the branch (STAMP path coordinate)
      worktreeAuthor - author for uncommitted stamps
      renderDate - date used for uncommitted stamps' time
      rangeLabel - label for coarse attribution of unpaired deletions in committed ranges, e.g. "9a958f7..HEAD"
  • Method Details

    • multipleStampsPossible

      public boolean multipleStampsPossible(boolean hasUncommitted)
      Whether the packet can carry more than one distinct stamp; when not, in-flow refs are suppressed and the cover states the single stamp once.
      Parameters:
      hasUncommitted - whether any compared content is uncommitted
      Returns:
      whether multiple stamps are possible
    • singleStampLine

      public String singleStampLine(String module)
      Render the single stamp's coordinate line for the cover when in-flow refs are suppressed.
      Parameters:
      module - the module label to print
      Returns:
      the one-line stamp statement
    • footnote

      public String footnote(String attribution, StampRegistry.Status status, String module)
      The reusable footnote macro for one attribution + status. Every call emits the full text; Asciidoctor keys reuse on the id.
      Parameters:
      attribution - an abbreviated commit id or GitSource.UNCOMMITTED
      status - the region's status
      module - the topic's domain
      Returns:
      the footnote:id[text] macro
    • usedStamps

      public List<StampRegistry.Stamp> usedStamps()
      The stamps actually used in this packet, in first-use order.
      Returns:
      the used stamps