public class LineWriter extends FilterWriter
FilterWriter
which allows to assign line/column numbers
to the Element
s being written by a DocumentWriter
.Modifier and Type | Field and Description |
---|---|
protected int |
columnNumber |
protected int |
lineNumber |
out
Constructor and Description |
---|
LineWriter(Writer out)
Create a new filtered writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
int |
getColumnNumber()
Returns current column number within current line.
|
int |
getLineNumber()
Returns current line number.
|
void |
write(char[] chars,
int offset,
int length) |
void |
write(int c) |
void |
write(String string,
int offset,
int length) |
void |
writeIndent(int indent) |
void |
writingElement(Element element)
Invoked by
DocumentWriter before the element is written to the
output destination. |
void |
writingInclusion(Inclusion inclusion)
Invoked by
DocumentWriter before the inclusion is written to the
output destination. |
public LineWriter(Writer out)
out
- a Writer object to provide the underlying stream.public void writingElement(Element element)
DocumentWriter
before the element is written to the
output destination.
Default implementation does nothing at all.
public void writingInclusion(Inclusion inclusion)
DocumentWriter
before the inclusion is written to the
output destination.
Default implementation does nothing at all.
public int getLineNumber()
public int getColumnNumber()
public void write(int c) throws IOException
write
in class FilterWriter
IOException
public void write(char[] chars, int offset, int length) throws IOException
write
in class FilterWriter
IOException
public void write(String string, int offset, int length) throws IOException
write
in class FilterWriter
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterWriter
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterWriter
IOException
public void writeIndent(int indent) throws IOException
IOException