|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.inxar.jenesis.MCodeWriter
Standard CodeWriter
implementation.
Constructor Summary | |
MCodeWriter(java.io.PrintWriter out)
|
Method Summary | |
CodeWriter |
dedentLine()
Decrements the tab and calls newLine() |
int |
getColumnNumber()
Returns the current number of characters in the current line. |
int |
getIndentNumber()
Returns the current number of indentation levels. |
int |
getLineNumber()
Returns the number of lines of the current document. |
CodeWriter |
indentLine()
Increments the tab and calls newLine() |
boolean |
isLineNew()
Returns true if no characters have been written since the last call of newLine(). |
CodeWriter |
newLine()
Adds a the newLine string according to System.getProperty("line.separator") and the
line is padded with the n tab characters where n is the number
returned by getIndentNumber() . |
void |
queue(Comment comment)
This method allows those codeable objects to inject a comment without interrupting the line-by-line code itself. |
CodeWriter |
resetLine()
Resets the tab counter to zero and calls the newLine() method. |
CodeWriter |
space()
Writes a single space. |
CodeWriter |
write(boolean b)
Writes a boolean. |
CodeWriter |
write(char c)
Writes a single character. |
CodeWriter |
write(char[] chars)
Writes an array of characters. |
CodeWriter |
write(char[] chars,
int off,
int len)
Writes an array of characters. |
CodeWriter |
write(Codeable ico)
Instead of calling the Object.toString() method,
the Object.toCode(public CodeWriter) method is invoked with
this as the argument. |
CodeWriter |
write(Codeable[] aico)
Iterates the array and sends each element to write(Codeable) . |
CodeWriter |
write(double d)
Writes a double. |
CodeWriter |
write(java.util.Enumeration enum)
Writes each object element of the given enumeration. |
CodeWriter |
write(float f)
Writes a float. |
CodeWriter |
write(int i)
Writes an integer. |
CodeWriter |
write(Iterator enum)
Writes each object element of the given enumeration. |
CodeWriter |
write(java.lang.Object o)
Writes an object. |
CodeWriter |
write(java.lang.Object[] ao)
Writes each element of the given object array. |
CodeWriter |
write(java.lang.String s)
Writes a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MCodeWriter(java.io.PrintWriter out)
Method Detail |
public CodeWriter write(boolean b)
write
in interface CodeWriter
public CodeWriter write(char c)
write
in interface CodeWriter
public CodeWriter write(char[] chars)
write
in interface CodeWriter
public CodeWriter write(char[] chars, int off, int len)
write
in interface CodeWriter
public CodeWriter write(int i)
write
in interface CodeWriter
public CodeWriter write(float f)
write
in interface CodeWriter
public CodeWriter write(double d)
write
in interface CodeWriter
public CodeWriter write(java.lang.String s)
write
in interface CodeWriter
public CodeWriter write(java.lang.Object o)
write
in interface CodeWriter
public CodeWriter write(java.lang.Object[] ao)
write
in interface CodeWriter
public CodeWriter write(Codeable ico)
Object.toString()
method,
the Object.toCode(public CodeWriter)
method is invoked with
this
as the argument.write
in interface CodeWriter
public CodeWriter write(Codeable[] aico)
write(Codeable)
.write
in interface CodeWriter
public CodeWriter write(java.util.Enumeration enum)
public CodeWriter write(Iterator enum)
write
in interface CodeWriter
public CodeWriter space()
space
in interface CodeWriter
public CodeWriter newLine()
System.getProperty("line.separator")
and the
line is padded with the n tab characters where n is the number
returned by getIndentNumber()
.newLine
in interface CodeWriter
public CodeWriter resetLine()
resetLine
in interface CodeWriter
public CodeWriter indentLine()
indentLine
in interface CodeWriter
public CodeWriter dedentLine()
dedentLine
in interface CodeWriter
public boolean isLineNew()
isLineNew
in interface CodeWriter
public int getIndentNumber()
getIndentNumber
in interface CodeWriter
public int getLineNumber()
getLineNumber
in interface CodeWriter
public int getColumnNumber()
getColumnNumber
in interface CodeWriter
public void queue(Comment comment)
queue
in interface CodeWriter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |