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) |
protected |
GeneratorWriter(File file,
String encoding) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
beforeClose(String string) |
boolean |
close() |
protected String |
encoding() |
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) |
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) |
void |
tabString(String string) |
String |
toString() |
protected GeneratorWriter(File file)
public void tabString(String string)
public File file()
public W print(char value)
public W print(int value)
public W println()
public W println(int value)
public W tab(int tabs)
public int tab()
public boolean 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 © 2018. All rights reserved.