public class WriterTarget extends java.lang.Object implements IndentationTarget
An IndentationTarget writing into a given Writer.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INDENTATION_STRING |
static java.lang.String |
LINE_SEPARATOR |
Constructor and Description |
---|
WriterTarget() |
WriterTarget(java.io.Writer pTarget) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString(JavaQName pQName)
Converts a class name into a string.
|
java.lang.String |
getIndentationString() |
java.lang.String |
getLineSeparator() |
java.io.Writer |
getTarget() |
void |
indent(int pLevel)
Indents the current line by adding blanks for the given
indentation level.
|
boolean |
isInterface()
Returns whether the IndentationEngine is creating a Java
interface.
|
void |
setIndentationString(java.lang.String pIndentationString) |
void |
setLineSeparator(java.lang.String pLineSeparator) |
void |
setTarget(java.io.Writer pTarget) |
void |
write()
Terminates a line in the target.
|
void |
write(java.lang.String pValue)
Writes a string to the target.
|
public static final java.lang.String INDENTATION_STRING
public static final java.lang.String LINE_SEPARATOR
public WriterTarget()
public WriterTarget(java.io.Writer pTarget)
public void setTarget(java.io.Writer pTarget)
public java.io.Writer getTarget()
public void setIndentationString(java.lang.String pIndentationString)
public java.lang.String getIndentationString()
public void setLineSeparator(java.lang.String pLineSeparator)
public java.lang.String getLineSeparator()
public boolean isInterface()
IndentationTarget
Returns whether the IndentationEngine is creating a Java interface. Creating an interface means, for example, that method bodies are being suppressed.
isInterface
in interface IndentationTarget
public void indent(int pLevel) throws java.io.IOException
IndentationTarget
Indents the current line by adding blanks for the given
indentation level. This method must be called before any
of the write(String)
or write()
methods or following the line terminating write()
method.
indent
in interface IndentationTarget
java.io.IOException
public java.lang.String asString(JavaQName pQName)
IndentationTarget
Converts a class name into a string. The string may then be
written to the target using write()
.
asString
in interface IndentationTarget
public void write(java.lang.String pValue) throws java.io.IOException
IndentationTarget
Writes a string to the target.
write
in interface IndentationTarget
java.io.IOException
public void write() throws java.io.IOException
IndentationTarget
Terminates a line in the target.
write
in interface IndentationTarget
java.io.IOException