public final class SpacingRules extends Object implements LayoutRule
( and before a close paren );a.b);( (function calls and groups stay tight —
keyword-introduced groups are re-spaced by the higher-priority S26 rule);*).This is the lowest-priority layout rule (LayoutPriorities.SPACING),
so later rules (clause linebreaks, indent, alignment) override its decisions
where they apply. It only sets blanksBefore; linebreaks/indent are
other rules' concern. Spacing around comment tokens is left to the original
whitespace (untouched) to avoid disturbing comment placement.
Iterative single pass; read-only over tokens. Plan reference: §7.3/S24, §7.4/S24.
| Constructor and Description |
|---|
SpacingRules() |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(LayoutContext context)
Apply the rule, requesting layout decisions on the context.
|
String |
name()
Short, stable identifier for logging/diagnostics.
|
int |
priority()
The rule's precedence.
|
public SpacingRules()
public int priority()
LayoutRulepriority in interface LayoutRulepublic String name()
LayoutRulename in interface LayoutRulepublic void apply(LayoutContext context)
LayoutRuleapply in interface LayoutRule