public final class Pp2OutputWriter extends Object
LayoutContext's per-token LayoutDecisionViews to the
final region string.
For each token it emits, in order:
linebreaksBefore newlines (decided value, else the token's
original precedingLinebreaks);blanksBefore spaces (decided value, else the token's original
precedingBlanks);textOverride when decided,
otherwise the source token text.The first token's leading whitespace is dropped: in production the
inter-region trivia / preamble is owned by RegionAssembler (S15), and
this writer emits only the region body. A plain StringBuilder is used
rather than pp.output.IPrinter to avoid the FormatterFactory
static OutputConfig field (plan forbidden #26).
Plan reference: §7.3/S31, §7.4/S31.
| Constructor and Description |
|---|
Pp2OutputWriter() |
| Modifier and Type | Method and Description |
|---|---|
String |
write(LayoutContext context)
Render the context's decisions to a string.
|
public Pp2OutputWriter()
public String write(LayoutContext context)
context - the layout context with decisions populated; must not be nullNullPointerException - if context is null