Class TextSignature

java.lang.Object
com.nsdev.lettergenerator.signature.TextSignature
All Implemented Interfaces:
SignatureContent

public final class TextSignature extends Object implements SignatureContent
Immutable plain-text signature part: single newlines change lines and blank lines separate paragraphs. Form-feed page breaks are forbidden. Instances can be safely reused; style(Style) returns a new part rather than changing the receiver.
  • Method Details

    • of

      public static TextSignature of(String text)
      Creates a signature with inherited document typography and no explicit style overrides. CRLF and CR are normalized when producing paragraph blocks.
      Parameters:
      text - non-null plain text without form-feed page breaks
      Returns:
      a new immutable text signature
      Throws:
      IllegalArgumentException - if text is null or contains a form-feed page break
    • style

      public TextSignature style(Style style)
      Creates a copy with replacement style overrides for all signature paragraphs. Unspecified fields inherit document typography; passing null removes explicit overrides. Detailed style validity is checked when generating the PDF.
      Parameters:
      style - paragraph style overrides, or null to inherit the document style
      Returns:
      a new signature; this instance is unchanged
    • blocks

      public List<Block> blocks()
      Exposes the ordered immutable blocks represented by this signature part. Text parts produce paragraphs; image parts produce one fitted image block.
      Specified by:
      blocks in interface SignatureContent
      Returns:
      immutable signature blocks, in display order