public class TextTableWriter extends TextWriter
Name Account ID Account Balance --------------- ---------- --------------- Richard Winters MJ-01 10567.25 Lewis Nixon LT-01 -298.1
Columns are the union of field names across all records in first-seen order; rows leave a blank
cell where a record has no value for a column. Records are buffered in memory until this writer
closes so column names and widths can be computed across the whole set — the table is only
written on close().
DataEndpoint.StatecurrentRecordlastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
TextTableWriter(File file) |
TextTableWriter(File file,
boolean append) |
TextTableWriter(Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
String |
getColumnSeparator() |
String |
getNewLine() |
TextTableWriter |
setColumnSeparator(String columnSeparator)
Assigns the string written between columns (defaults to two spaces).
|
TextTableWriter |
setNewLine(String newLine)
Assigns the string used between each line (defaults to "\n" on Linux and "\r\n" on Windows).
|
protected void |
writeRecord(Record record) |
getFile, getWriter, isAppend, isAutoCloseWriter, isFieldNamesInFirstRow, isFlushOnWrite, setAutoCloseWriter, setFlushOnWrite, writecreateHeaderRecord, isHeaderRow, open, setFieldNamesInFirstRow, writeImplavailable, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, getWriterdecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic TextTableWriter(File file, boolean append)
file - append - Indicates if writing should start at the end of the file (if it exists). If the specified file exists and has contents
(more than 0 bytes), then the fieldNamesInFirstRow property will be set to false.public TextTableWriter(File file)
public TextTableWriter(Writer writer)
public String getNewLine()
public TextTableWriter setNewLine(String newLine)
public String getColumnSeparator()
public TextTableWriter setColumnSeparator(String columnSeparator)
protected void writeRecord(Record record) throws Throwable
writeRecord in class AbstractWriterThrowablepublic void close()
DataEndpointclose in class TextWriterpublic DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class TextWriterCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.