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 | Constructor and Description |
|---|---|
protected |
GeneratorWriter(File file) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
beforeClose(String string) |
void |
close() |
File |
file() |
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) |
protected String |
ref(Class<?> clazz)
Get a reference to a
Class. |
protected 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. |
protected String |
ref(String clazzOrId)
Get a reference to a
Class. |
protected 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 |
toString() |
protected GeneratorWriter(File file)
public final File file()
public final W print(char value)
public final W print(int value)
public final W println()
public final W println(int value)
public final W tab(int tabs)
public final int tab()
public final void close()
protected final List<String> ref(List<String> clazzOrId)
Class.
Subtypes may override this to generate import statements.
protected final 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 © 2015. All Rights Reserved.