public final class JFormatter extends Object
Constructor and Description |
---|
JFormatter(PrintWriter s)
Creates a formatter with default incremental indentations of
four spaces.
|
JFormatter(PrintWriter s,
String space)
Creates a JFormatter.
|
JFormatter(Writer w)
Creates a formatter with default incremental indentations of
four spaces.
|
Modifier and Type | Method and Description |
---|---|
JFormatter |
b(JVar v)
Cause the JVar to generate source for itself
|
void |
close()
Closes this formatter.
|
JFormatter |
d(JDeclaration d)
Cause the JDeclaration to generate source for itself
|
JFormatter |
g(Collection<? extends JGenerable> list)
Produces
JGenerable s separated by ',' |
JFormatter |
g(JGenerable g)
Cause the JGenerable object to generate source for iteself
|
JFormatter |
i()
Increment the indentation level.
|
JFormatter |
id(String id)
Print an identifier
|
boolean |
isPrinting()
Returns true if we are in the printing mode,
where we actually produce text.
|
JFormatter |
nl()
Print a new line into the stream
|
JFormatter |
o()
Decrement the indentation level.
|
JFormatter |
p(char c)
Print a char into the stream
|
JFormatter |
p(String s)
Print a String into the stream
|
JFormatter |
s(JStatement s)
Cause the JStatement to generate source for itself
|
JFormatter |
t(JClass type)
Print a type name.
|
JFormatter |
t(JType type) |
public JFormatter(PrintWriter s, String space)
s
- PrintWriter to JFormatter to use.space
- Incremental indentation string, similar to tab value.public JFormatter(PrintWriter s)
public JFormatter(Writer w)
public void close()
public boolean isPrinting()
public JFormatter o()
public JFormatter i()
public JFormatter p(char c)
c
- the charpublic JFormatter p(String s)
s
- the Stringpublic JFormatter t(JType type)
public JFormatter t(JClass type)
In the collecting mode we use this information to decide what types to import and what not to.
public JFormatter id(String id)
public JFormatter nl()
public JFormatter g(JGenerable g)
g
- the JGenerable objectpublic JFormatter g(Collection<? extends JGenerable> list)
JGenerable
s separated by ','public JFormatter d(JDeclaration d)
d
- the JDeclaration objectpublic JFormatter s(JStatement s)
s
- the JStatement objectpublic JFormatter b(JVar v)
v
- the JVar objectCopyright © 2019 JBoss by Red Hat. All rights reserved.