class ExpressionWriter extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
ExpressionWriter.Indent
Helps generate strings of spaces, to indent text.
|
| Modifier and Type | Field and Description |
|---|---|
private StringBuilder |
buf |
private boolean |
generics |
private String |
indent |
(package private) static ExpressionWriter.Indent |
INDENT |
private boolean |
indentPending |
private int |
level |
| Constructor and Description |
|---|
ExpressionWriter() |
ExpressionWriter(boolean generics) |
| Modifier and Type | Method and Description |
|---|---|
ExpressionWriter |
append(AbstractNode o) |
ExpressionWriter |
append(char c) |
ExpressionWriter |
append(Object o) |
ExpressionWriter |
append(String s) |
ExpressionWriter |
append(Type type) |
void |
backUp() |
void |
begin()
Increases the indentation level.
|
ExpressionWriter |
begin(String s) |
private void |
checkIndent() |
void |
end()
Decreases the indentation level.
|
ExpressionWriter |
end(String s) |
StringBuilder |
getBuf() |
ExpressionWriter |
indent() |
ExpressionWriter |
list(String begin,
String sep,
String end,
Iterable<?> list) |
ExpressionWriter |
newlineAndIndent() |
boolean |
requireParentheses(Expression expression,
int lprec,
int rprec)
If parentheses are required, writes this expression out with
parentheses and returns true.
|
String |
toString() |
void |
write(Node expression) |
static final ExpressionWriter.Indent INDENT
private final StringBuilder buf
private int level
private String indent
private boolean indentPending
private final boolean generics
public ExpressionWriter()
public ExpressionWriter(boolean generics)
public void write(Node expression)
public boolean requireParentheses(Expression expression, int lprec, int rprec)
public void begin()
public void end()
public ExpressionWriter newlineAndIndent()
public ExpressionWriter indent()
public ExpressionWriter begin(String s)
public ExpressionWriter end(String s)
public ExpressionWriter append(char c)
public ExpressionWriter append(Type type)
public ExpressionWriter append(AbstractNode o)
public ExpressionWriter append(Object o)
public ExpressionWriter append(String s)
private void checkIndent()
public StringBuilder getBuf()
public ExpressionWriter list(String begin, String sep, String end, Iterable<?> list)
public void backUp()
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.