Table of Contents

Class FooterTemplate

Namespace
JD.AI.Rendering
Assembly
JD.AI.dll

A parsed footer template that can render itself given a dictionary of segment values.

public sealed class FooterTemplate
Inheritance
FooterTemplate
Inherited Members

Remarks

Template syntax:

  • {key} — required segment (omitted silently if key is not in the dictionary)
  • {key?} — conditional segment (also omitted when value is null or empty)
  • Any other text — rendered as-is

Adjacent separator literals (, |, ·, , -, , or whitespace-only strings) that surround omitted segments are collapsed so that "A │ │ D" becomes "A │ D".

Properties

Tokens

The ordered list of tokens that make up this template.

public IReadOnlyList<TemplateToken> Tokens { get; }

Property Value

IReadOnlyList<TemplateToken>

Methods

Parse(string)

Parses template into a FooterTemplate.

public static FooterTemplate Parse(string template)

Parameters

template string

Returns

FooterTemplate

Render(IReadOnlyDictionary<string, string?>?)

Renders the template by substituting values from segments. Conditional segments whose value is null or empty string are omitted, and adjacent separator literals are collapsed to prevent double-separator artifacts.

public string Render(IReadOnlyDictionary<string, string?>? segments)

Parameters

segments IReadOnlyDictionary<string, string>

Returns

string