|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
org.codehaus.modello.generator.java.javasource.JSourceWriter
The writer used by the modello classes
Field Summary | |
private boolean |
addIndentation
Flag for indicating whether we need to add the whitespace to beginning of next write call |
private boolean |
autoflush
A flag indicating whether this JSourceWriter should perform autoflush at the end of a new line |
static char |
DEFAULT_CHAR
The default character to use for indentation |
static short |
DEFAULT_SIZE
The default indentation size |
private java.lang.String |
lineSeparator
The line separator to use for the writeln methods |
private java.io.Writer |
out
The writer to send all output to |
private char[] |
tab
The tab representation |
private char |
tabChar
The character to use for indentation |
private short |
tabLevel
The current tab level |
private short |
tabSize
The tab (indentation) size |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
JSourceWriter(java.io.Writer out)
Creates a new JSourceWriter |
|
JSourceWriter(java.io.Writer out,
boolean autoflush)
Creates a new JSourceWriter |
|
JSourceWriter(java.io.Writer out,
short tabSize,
boolean autoflush)
Creates a new JSourceWriter |
|
JSourceWriter(java.io.Writer out,
short tabSize,
char tabChar,
boolean autoflush)
Creates a new JSourceWriter |
Method Summary | |
void |
close()
|
private void |
createTab()
Creates the tab from the tabSize and the tabChar |
private void |
ensureIndent()
|
void |
flush()
|
protected char |
getIndentChar()
|
protected short |
getIndentLevel()
|
protected short |
getIndentSize()
Returns the current indent size (getIndentLevel()*tabSize); |
java.lang.String |
getLineSeparator()
Returns the line separator being used by this JSourceWriter |
void |
indent()
Increases the indentation level by 1 |
boolean |
isNewline()
Checks to see if the cursor is positioned on a new line |
private void |
linefeed()
writes the line separator character to the writer |
void |
setLineSeparator(java.lang.String lineSeparator)
Sets the line separator to use at the end of each line |
void |
unindent()
Decreases the indentation level by 1 |
void |
write(boolean b)
|
void |
write(char[] buf)
|
void |
write(char[] buf,
int off,
int len)
|
void |
write(double d)
|
void |
write(float f)
|
void |
write(int c)
|
void |
write(long l)
|
void |
write(java.lang.Object obj)
|
void |
write(java.lang.String s)
|
void |
write(java.lang.String s,
int off,
int len)
|
protected void |
writeIndent()
|
void |
writeln()
|
void |
writeln(boolean b)
|
void |
writeln(char c)
|
void |
writeln(char[] chars)
|
void |
writeln(double d)
|
void |
writeln(float f)
|
void |
writeln(int i)
|
void |
writeln(long l)
|
void |
writeln(java.lang.Object obj)
|
void |
writeln(java.lang.String string)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char DEFAULT_CHAR
public static final short DEFAULT_SIZE
private java.lang.String lineSeparator
private boolean addIndentation
private boolean autoflush
private short tabSize
private char[] tab
private char tabChar
private short tabLevel
private java.io.Writer out
Constructor Detail |
public JSourceWriter(java.io.Writer out)
out
- the Writer to write the actual output topublic JSourceWriter(java.io.Writer out, boolean autoflush)
out
- the Writer to write the actual output toautoflush
- a boolean indicating whether or not to
perform automatic flush at the end of a linepublic JSourceWriter(java.io.Writer out, short tabSize, boolean autoflush)
out
- the Writer to write the actual output totabSize
- the size of each indentationautoflush
- a boolean indicating whether or not to
perform automatic flush at the end of a linepublic JSourceWriter(java.io.Writer out, short tabSize, char tabChar, boolean autoflush)
out
- the Writer to write the actual output totabSize
- the size of each indentationtabChar
- the character to use for indentationautoflush
- a boolean indicating whether or not to
perform automatic flush at the end of a lineMethod Detail |
public java.lang.String getLineSeparator()
public void indent()
public boolean isNewline()
public void setLineSeparator(java.lang.String lineSeparator)
lineSeparator
- the String to use as a line
separator.
public void unindent()
public void write(float f)
public void write(long l)
public void write(double d)
public void write(java.lang.Object obj)
public void write(boolean b)
public void writeln()
public void writeln(float f)
public void writeln(long l)
public void writeln(int i)
public void writeln(double d)
public void writeln(java.lang.Object obj)
public void writeln(java.lang.String string)
public void writeln(char[] chars)
public void writeln(boolean b)
public void writeln(char c)
public void close()
public void flush()
public void write(java.lang.String s, int off, int len)
public void write(java.lang.String s)
public void write(char[] buf)
public void write(int c)
public void write(char[] buf, int off, int len)
protected short getIndentLevel()
protected short getIndentSize()
protected char getIndentChar()
protected void writeIndent()
private void ensureIndent()
private void linefeed()
private void createTab()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |