public abstract class SourceWriterBase extends java.lang.Object implements SourceWriter
SourceWriter
that implements all the indenting
and keeping track of comments.
Experimental API - subject to change.
Constructor and Description |
---|
SourceWriterBase() |
Modifier and Type | Method and Description |
---|---|
abstract void |
abort()
Abort the source file being generated.
|
void |
beginJavaDocComment()
Begin emitting a JavaDoc comment.
|
void |
close()
Close the source file being generated.
|
void |
endJavaDocComment()
End emitting a JavaDoc comment.
|
void |
indent()
Increase indent level.
|
void |
indentln(java.lang.String string)
Print a line at an increased indentation level without altering the indent
level for the next line.
|
void |
indentln(java.lang.String format,
java.lang.Object... args)
Format and print a line at an increased indentation level without altering
the indent level for the next line.
|
void |
outdent()
Decrease indent level.
|
void |
print(java.lang.String s)
Write a string without a line terminator.
|
void |
print(java.lang.String format,
java.lang.Object... args)
Format and print a string without a line terminator.
|
void |
println()
Write a line terminator.
|
void |
println(java.lang.String string)
Write a string with a line terminator.
|
void |
println(java.lang.String format,
java.lang.Object... args)
Format and print a string with a line terminator.
|
protected abstract void |
writeString(java.lang.String s)
Write a string to the underlying output.
|
public abstract void abort()
SourceWriter
abort
in interface SourceWriter
public void beginJavaDocComment()
SourceWriter
beginJavaDocComment
in interface SourceWriter
public void close()
SourceWriter
close
in interface SourceWriter
public void endJavaDocComment()
SourceWriter
endJavaDocComment
in interface SourceWriter
public void indent()
SourceWriter
indent
in interface SourceWriter
public void indentln(java.lang.String string)
SourceWriter
indentln
in interface SourceWriter
public void indentln(java.lang.String format, java.lang.Object... args)
SourceWriter
indentln
in interface SourceWriter
format
- format string, as in String.format(String, Object...)
args
- arguments for the format stringpublic void outdent()
SourceWriter
outdent
in interface SourceWriter
public void print(java.lang.String s)
SourceWriter
print
in interface SourceWriter
public void print(java.lang.String format, java.lang.Object... args)
SourceWriter
print
in interface SourceWriter
format
- format string, as in String.format(String, Object...)
args
- arguments for the format stringpublic void println()
SourceWriter
println
in interface SourceWriter
public void println(java.lang.String string)
SourceWriter
println
in interface SourceWriter
public void println(java.lang.String format, java.lang.Object... args)
SourceWriter
println
in interface SourceWriter
format
- format string, as in String.format(String, Object...)
args
- arguments for the format stringprotected abstract void writeString(java.lang.String s)
s
-