public abstract class AbstractWriter extends Object implements Writer
Modifier and Type | Field and Description |
---|---|
protected String |
lineSeparator |
Constructor and Description |
---|
AbstractWriter(Writer output) |
AbstractWriter(Writer writer,
String lineSeparator) |
Modifier and Type | Method and Description |
---|---|
Writer |
addRecordEntry(String columnName,
Object value) |
void |
close() |
Writer |
flush() |
protected Map<String,Object> |
getRowMap() |
Writer |
nextRecord()
Writes a newline to the output and discards the
rowMap . |
protected abstract boolean |
validateColumnTitle(String columnTitle)
Subclasses must implement this method to perform validation of
columnTitle . |
protected void |
write(char character) |
protected void |
write(char[] characters) |
protected void |
write(Object val) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
printFooter, printHeader
protected String lineSeparator
public AbstractWriter(Writer output)
public Writer addRecordEntry(String columnName, Object value)
addRecordEntry
in interface Writer
protected abstract boolean validateColumnTitle(String columnTitle)
columnTitle
.columnTitle
- title of the column to be filledtrue
if the column title is valid else return
false
.public Writer nextRecord() throws IOException
rowMap
.
This method must be overridden by subclasses to write out the record data
stored in rowMap
. Overriders must call
super.nextRecord()
as the last call in their implementation.
nextRecord
in interface Writer
IOException
protected void write(Object val) throws IOException
IOException
protected void write(char character) throws IOException
IOException
protected void write(char[] characters) throws IOException
IOException
public Writer flush() throws IOException
flush
in interface Writer
IOException
public void close() throws IOException
close
in interface AutoCloseable
close
in interface Writer
IOException
Copyright © 2006–2021 Appendium - Portfolio Financing Platform. All rights reserved.