|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.devkit.model.code.Formatter
public final class Formatter
This is a utility class for managing indentation and other basic formatting for PrintWriter.
| Constructor Summary | |
|---|---|
Formatter(PrintWriter s)
Creates a formatter with default incremental indentations of four spaces. |
|
Formatter(PrintWriter s,
String space)
Creates a Formatter. |
|
Formatter(Writer w)
Creates a formatter with default incremental indentations of four spaces. |
|
| Method Summary | |
|---|---|
Formatter |
b(GeneratedVariable v)
Cause the Variable to generate source for itself |
void |
close()
Closes this formatter. |
Formatter |
d(Declaration d)
Cause the Declaration to generate source for itself |
Formatter |
g(Collection<? extends Generable> list)
Produces Generables separated by ',' |
Formatter |
g(Generable g)
Cause the Generable object to generate source for iteself |
Formatter |
i()
Increment the indentation level. |
Formatter |
id(String id)
Print an identifier |
boolean |
isPrinting()
Returns true if we are in the printing mode, where we actually produce text. |
Formatter |
nl()
Print a new line into the stream |
Formatter |
o()
Decrement the indentation level. |
Formatter |
p(char c)
Print a char into the stream |
Formatter |
p(String s)
Print a String into the stream |
Formatter |
s(Statement s)
Cause the Statement to generate source for itself |
Formatter |
t(Type type)
|
Formatter |
t(TypeReference type)
Print a type name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Formatter(PrintWriter s,
String space)
s - PrintWriter to Formatter to use.space - Incremental indentation string, similar to tab value.public Formatter(PrintWriter s)
public Formatter(Writer w)
| Method Detail |
|---|
public void close()
public boolean isPrinting()
public Formatter o()
public Formatter i()
public Formatter p(char c)
c - the charpublic Formatter p(String s)
s - the Stringpublic Formatter t(Type type)
public Formatter t(TypeReference type)
public Formatter id(String id)
public Formatter nl()
public Formatter g(Generable g)
g - the Generable objectpublic Formatter g(Collection<? extends Generable> list)
Generables separated by ','
public Formatter d(Declaration d)
d - the Declaration objectpublic Formatter s(Statement s)
s - the Statement objectpublic Formatter b(GeneratedVariable v)
v - the Variable object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||