public abstract class GeneratorWriter<W extends GeneratorWriter<W>> extends Object
PrintWriter
This wrapper postpones the actual write to the wrapped PrintWriter
until all information about the target Java class is available. This way, the
import dependencies can be calculated at the end.
| Modifier and Type | Class and Description |
|---|---|
static class |
GeneratorWriter.CloseResult |
| Modifier | Constructor and Description |
|---|---|
protected |
GeneratorWriter(File file) |
protected |
GeneratorWriter(File file,
Files files) |
protected |
GeneratorWriter(File file,
String encoding) |
protected |
GeneratorWriter(File file,
String encoding,
Files files) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
beforeClose(String string) |
GeneratorWriter.CloseResult |
close() |
protected String |
encoding() |
File |
file() |
int |
indent() |
W |
indent(int tabs) |
W |
indentDec() |
W |
indentInc() |
String |
newlineString() |
void |
newlineString(String string) |
W |
print(char value) |
W |
print(int value) |
W |
print(String string) |
W |
print(String string,
Object... args) |
W |
println() |
W |
println(int value) |
W |
println(String string) |
W |
println(String string,
Object... args) |
W |
printlnIf(boolean condition) |
String |
ref(Class<?> clazz)
Get a reference to a
Class. |
List<String> |
ref(List<String> clazzOrId)
Get a reference to a list of
Class. |
protected List<String> |
ref(List<String> clazzOrId,
int keepSegments)
Get a reference to a list of
Class. |
String |
ref(String clazzOrId)
Get a reference to a
Class. |
String[] |
ref(String[] clazzOrId)
Get a reference to a list of
Class. |
protected String[] |
ref(String[] clazzOrId,
int keepSegments)
Get a reference to a list of
Class. |
protected String |
ref(String clazzOrId,
int keepSegments)
Get a reference to a
Class. |
int |
tab() |
W |
tab(int tabs) |
String |
tabString() |
void |
tabString(String string) |
String |
toString() |
protected GeneratorWriter(File file)
public String tabString()
public void tabString(String string)
public String newlineString()
public void newlineString(String string)
public File file()
public W print(char value)
public W print(int value)
public W printlnIf(boolean condition)
public W println()
public W println(int value)
public W indentInc()
public W indentDec()
public W indent(int tabs)
public int indent()
public W tab(int tabs)
public int tab()
public GeneratorWriter.CloseResult close()
protected String encoding()
public List<String> ref(List<String> clazzOrId)
Class.
Subtypes may override this to generate import statements.
protected String[] ref(String[] clazzOrId, int keepSegments)
Class.protected List<String> ref(List<String> clazzOrId, int keepSegments)
Class.
Subtypes may override this to generate import statements.
Copyright © 2021. All rights reserved.