Class PreparedLetterTemplate

java.lang.Object
com.nsdev.lettergenerator.template.PreparedLetterTemplate

public final class PreparedLetterTemplate extends Object
Immutable parsed template and configuration, safe for concurrent independent binding.
  • Constructor Details

    • PreparedLetterTemplate

      public PreparedLetterTemplate(String source, Map<String,?> values, Map<String,byte[]> assets, boolean substitute, LetterTheme theme, Map<String,LetterComponent> components, DocumentSettings settings)
      Captures source and configuration from a builder, parsing once.
      Parameters:
      source - supported markup
      values - typed default bindings
      assets - explicitly named encoded images
      substitute - binding mode
      theme - optional theme
      components - reusable model components
      settings - optional document settings
  • Method Details

    • requirements

      public TemplateRequirements requirements()
      Returns:
      immutable syntactic requirements with source selectors
    • build

      public LetterDocument build()
      Returns:
      a fresh document using the bindings captured at compile time
    • bind

      public LetterDocument bind(Map<String,?> replacements)
      Replaces all captured bindings for this call without changing the prepared template.
      Parameters:
      replacements - non-null owned typed data
      Returns:
      independent immutable letter document
    • validate

      public ValidationReport validate()
      Returns:
      authoring report using built-in fonts and captured bindings
    • validate

      public ValidationReport validate(LetterPdfGenerator generator)
      Validates captured bindings and configuration without native layout.
      Parameters:
      generator - explicit font-aware validator
      Returns:
      aggregated authoring report