| |
|
| java.lang.Object com.sun.codemodel.JFormatter
JFormatter | final public class JFormatter (Code) | | This is a utility class for managing indentation and other basic
formatting for PrintWriter.
|
Inner Class :final class ReferenceList | |
Field Summary | |
final static char | CLOSE_TYPE_ARGS Special character token we use to differenciate '>' as an operator and
'>' as the end of the type arguments. |
CLOSE_TYPE_ARGS | final static char CLOSE_TYPE_ARGS(Code) | | Special character token we use to differenciate '>' as an operator and
'>' as the end of the type arguments. The former uses '>' and it requires
a preceding whitespace. The latter uses this, and it does not have a preceding
whitespace.
|
JFormatter | public JFormatter(PrintWriter s, String space)(Code) | | Creates a JFormatter.
Parameters: s - PrintWriter to JFormatter to use. Parameters: space - Incremental indentation string, similar to tab value. |
JFormatter | public JFormatter(PrintWriter s)(Code) | | Creates a formatter with default incremental indentations of
four spaces.
|
JFormatter | public JFormatter(Writer w)(Code) | | Creates a formatter with default incremental indentations of
four spaces.
|
b | public JFormatter b(JVar v)(Code) | | Cause the JVar to generate source for itself
Parameters: v - the JVar object |
close | public void close()(Code) | | Closes this formatter.
|
g | public JFormatter g(JGenerable g)(Code) | | Cause the JGenerable object to generate source for iteself
Parameters: g - the JGenerable object |
isPrinting | public boolean isPrinting()(Code) | | Returns true if we are in the printing mode,
where we actually produce text.
The other mode is the "collecting mode'
|
p | public JFormatter p(char c)(Code) | | Print a char into the stream
Parameters: c - the char |
t | public JFormatter t(JClass type)(Code) | | Print a type name.
In the collecting mode we use this information to
decide what types to import and what not to.
|
write | void write(JDefinedClass c)(Code) | | Generates the whole source code out of the specified class.
|
|
|
|