public final class Formatter extends Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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
Generable s 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.
|
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)
public void close()
public boolean isPrinting()
public Formatter o()
public Formatter i()
public Formatter p(char c)
c
- the charpublic Formatter t(TypeReference type)
public Formatter nl()
public Formatter g(Generable g)
g
- the Generable objectpublic Formatter g(Collection<? extends Generable> list)
Generable
s 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 objectCopyright © 2010–2015 MuleSoft, Inc.. All rights reserved.