public class JavaWriterWrapper extends JavaWriter
Constructor and Description |
---|
JavaWriterWrapper(JavaWriter writer) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
errorMessage(java.lang.String message)
Returns the error message with proper line number.
|
int |
generateId()
Generates a unique id.
|
int |
getDestLine()
Returns the destination line.
|
LineMap |
getLineMap()
Gets the line map
|
WriteStream |
getWriteStream()
Returns the underlying stream.
|
void |
popDepth()
Pops an indentation depth.
|
void |
print(boolean b)
Prints a boolean.
|
void |
print(char ch)
Prints a character.
|
void |
print(int i)
Prints an integer.
|
void |
print(long l)
Prints an long
|
void |
print(java.lang.Object o)
Prints an object.
|
void |
print(java.lang.String s)
Prints a string
|
void |
printClass(java.lang.Class cl)
Prints the Java represention of the class
|
void |
printIndent()
Prints the indentation at the beginning of a line.
|
void |
printJavaChar(char ch)
Prints a Java escaped string
|
void |
printJavaString(java.lang.String s)
Prints a Java escaped string
|
void |
printJavaTypeToObject(java.lang.String value,
java.lang.Class javaType)
Converts a java primitive type to a Java object.
|
void |
printJavaTypeToObject(java.lang.String value,
JClass javaType)
Converts a java primitive type to a Java object.
|
void |
println()
Prints a newline
|
void |
println(boolean v)
Prints a boolean with a new line
|
void |
println(char ch)
Prints a character.
|
void |
println(int v)
Prints an integer with a new line
|
void |
println(long v)
Prints an long with a new line
|
void |
println(java.lang.Object v)
Prints an object with a new line
|
void |
println(java.lang.String s)
Prints a string with a new line
|
void |
printQuotedJavaString(java.lang.String s)
Prints a Java escaped string surrounded by ", or null if the string is null.
|
void |
pushDepth()
Pushes an indentation depth.
|
void |
setLineMap(LineMap lineMap)
Sets the line map
|
void |
setLocation(java.lang.String filename,
int line)
Sets the source filename and line.
|
close, escapeJavaString, flush, generateSmap, printType, printVarType, setPreferLast, write
public JavaWriterWrapper(JavaWriter writer)
public WriteStream getWriteStream()
getWriteStream
in class JavaWriter
public int getDestLine()
getDestLine
in class JavaWriter
public void setLineMap(LineMap lineMap)
setLineMap
in class JavaWriter
public LineMap getLineMap()
getLineMap
in class JavaWriter
public void setLocation(java.lang.String filename, int line) throws java.io.IOException
setLocation
in class JavaWriter
filename
- the filename of the source file.line
- the line of the source file.java.io.IOException
public int generateId()
generateId
in class JavaWriter
public void printJavaString(java.lang.String s) throws java.io.IOException
printJavaString
in class JavaWriter
java.io.IOException
public void printQuotedJavaString(java.lang.String s) throws java.io.IOException
java.io.IOException
public void printJavaChar(char ch) throws java.io.IOException
printJavaChar
in class JavaWriter
java.io.IOException
public void pushDepth() throws java.io.IOException
pushDepth
in class JavaWriter
java.io.IOException
public void popDepth() throws java.io.IOException
popDepth
in class JavaWriter
java.io.IOException
public void print(java.lang.String s) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void print(char ch) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void print(boolean b) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void print(int i) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void print(long l) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void print(java.lang.Object o) throws java.io.IOException
print
in class JavaWriter
java.io.IOException
public void println(java.lang.String s) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println(boolean v) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println(char ch) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println(int v) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println(long v) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println(java.lang.Object v) throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void println() throws java.io.IOException
println
in class JavaWriter
java.io.IOException
public void printClass(java.lang.Class cl) throws java.io.IOException
printClass
in class JavaWriter
java.io.IOException
public void printJavaTypeToObject(java.lang.String value, java.lang.Class javaType) throws java.io.IOException
printJavaTypeToObject
in class JavaWriter
value
- the java expression to be convertedjavaType
- the type of the converted expression.java.io.IOException
public void printJavaTypeToObject(java.lang.String value, JClass javaType) throws java.io.IOException
printJavaTypeToObject
in class JavaWriter
value
- the java expression to be convertedjavaType
- the type of the converted expression.java.io.IOException
public void printIndent() throws java.io.IOException
printIndent
in class JavaWriter
java.io.IOException
public java.lang.String errorMessage(java.lang.String message)
errorMessage
in class JavaWriter