Class JsonExporter

All Implemented Interfaces:
JustificationVisitor<Void>

public class JsonExporter extends AbstractModelExporter
Serialises a single JustificationModel to JSON text.

Uses org.json (already a declared dependency) for correct string escaping. The library is used internally as a builder; the pipeline type remains String, consistent with other text exporters (ADR-0013).

Output schema:

{
  "name": "...",
  "type": "justification" | "template",
  "elements": [ { "type": "...", "id": "...", "label": "...",
                  "aliases": [ "..." ] }, ... ],
  "relations": [ { "source": "...", "target": "..." }, ... ]
}

The optional per-element "aliases" array lists the qualified original ids that were merged into the element during composition/unification; it is omitted for elements that are not the target of any alias. Merges compose, so the array is transitive: composing the result of a composition records a chain, and the array lists every id along it, down to those written in the original source models.