public abstract class LinedTextWriter extends TextWriter
DataEndpoint.State
currentRecord
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
LinedTextWriter(File file) |
LinedTextWriter(File file,
boolean append) |
LinedTextWriter(Writer writer) |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
protected abstract void |
assembleLine(Record record,
StringBuilder lineBuffer) |
String |
getNewLine() |
LinedTextWriter |
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) |
close, getFile, getWriter, isAppend, isAutoCloseWriter, isFieldNamesInFirstRow, isFlushOnWrite, setAutoCloseWriter, setFlushOnWrite, write
open, setFieldNamesInFirstRow, writeImpl
available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public LinedTextWriter(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 LinedTextWriter(File file)
public LinedTextWriter(Writer writer)
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class TextWriter
public String getNewLine()
public LinedTextWriter setNewLine(String newLine)
protected final void writeRecord(Record record) throws Throwable
writeRecord
in class AbstractWriter
Throwable
protected abstract void assembleLine(Record record, StringBuilder lineBuffer) throws Throwable
Throwable
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.