public final class ClauseLinebreakRules extends Object implements LayoutRule
FROM, WHERE, GROUP BY, HAVING,
ORDER BY.
It breaks before a token that carries the TokenRole.KEYWORD_CLAUSE
role (set by S21) whose ClausePart is one of the targeted clauses. It
does not break before JOIN keywords (S26 owns JOIN layout) nor before a
clause keyword that immediately follows a master keyword (so DELETE FROM
/ INSERT INTO stay on one line). SELECT master layout and set
operators are handled by SetOperatorRules.
Priority LayoutPriorities.CLAUSE_LINEBREAK. Requires the
ClauseScopeAnnotator.ClauseScopeResult to be attached to the context. Iterative; read-only
over tokens.
Plan reference: §7.3/S25, §7.4/S25.
| Constructor and Description |
|---|
ClauseLinebreakRules() |
| 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 ClauseLinebreakRules()
public int priority()
LayoutRulepriority in interface LayoutRulepublic String name()
LayoutRulename in interface LayoutRulepublic void apply(LayoutContext context)
LayoutRuleapply in interface LayoutRule