public abstract class TextStreamWriter extends DataWriter
TextWriter, this writer doesn't force the concept of
fieldNamesInFirstRow and doesn't assume the output is line based.DataEndpoint.StatelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
TextStreamWriter(File file) |
TextStreamWriter(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.
|
File |
getFile() |
BufferedWriter |
getWriter() |
boolean |
isAutoCloseWriter()
Indicates if the underlying java.io.BufferedWriter should be closed when this stream closes (defaults to true).
|
boolean |
isFlushOnWrite()
Indicates if the underlying java.io.BufferedWriter should be flushed after each record is written.
|
TextStreamWriter |
setAutoCloseWriter(boolean autoCloseWriter)
Indicates if the underlying java.io.BufferedWriter should be closed when this stream closes (defaults to true).
|
TextStreamWriter |
setFlushOnWrite(boolean flushOnWrite)
Indicates if the underlying java.io.BufferedWriter should be flushed after each record is written (defaults to false).
|
void |
write(Record record)
Writes the specified record to this
DataWriter and increases the record-count by 1. |
available, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, getWriter, writeImpldecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, open, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic TextStreamWriter(File file)
public TextStreamWriter(Writer writer)
public BufferedWriter getWriter()
public File getFile()
public boolean isAutoCloseWriter()
public TextStreamWriter setAutoCloseWriter(boolean autoCloseWriter)
public boolean isFlushOnWrite()
public TextStreamWriter setFlushOnWrite(boolean flushOnWrite)
public void close()
DataEndpointclose in class DataEndpointpublic void write(Record record) throws DataException
DataWriterDataWriter and increases the record-count by 1.
Any exception raised while writing will be converted to a DataException using DataObject.exception(Throwable).
Subclasses generally do not need to override this method, instead they should implement DataWriter.writeImpl(Record).
write in class DataWriterDataExceptionpublic 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 DataWriterCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.