public class FixedWidthWriter extends LinedTextWriter
DataEndpoint.StatecurrentRecordlastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
FixedWidthWriter(File file) |
FixedWidthWriter(File file,
boolean append) |
FixedWidthWriter(Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
FixedWidthWriter |
addField(FixedWidthField field) |
FixedWidthWriter |
addField(int width,
FixedWidthAlign align,
char fillChar) |
FixedWidthWriter |
addFields(int... width) |
protected void |
assembleLine(Record record,
StringBuilder lineBuffer) |
char |
getFillChar() |
boolean |
isTruncateFields() |
FixedWidthWriter |
setAutoCloseWriter(boolean autoCloseWriter)
Indicates if the underlying java.io.BufferedWriter should be closed when this stream closes (defaults to true).
|
FixedWidthWriter |
setDescription(String description) |
FixedWidthWriter |
setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) |
FixedWidthWriter |
setFillChar(char fillChar) |
FixedWidthWriter |
setFlushOnWrite(boolean flushOnWrite)
Indicates if the underlying java.io.BufferedWriter should be flushed after each record is written (defaults to false).
|
FixedWidthWriter |
setNewLine(String newLine)
Assigns the string used between each line (defaults to "\n" on Linux and "\r\n" on Windows).
|
FixedWidthWriter |
setTruncateFields(boolean truncateFields) |
getNewLine, writeRecordclose, getFile, getWriter, isAppend, isAutoCloseWriter, isFieldNamesInFirstRow, isFlushOnWrite, writeopen, 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, setCaptureElapsedTimepublic FixedWidthWriter(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 FixedWidthWriter(File file)
public FixedWidthWriter(Writer writer)
public char getFillChar()
public FixedWidthWriter setFillChar(char fillChar)
public boolean isTruncateFields()
public FixedWidthWriter setTruncateFields(boolean truncateFields)
public FixedWidthWriter addField(FixedWidthField field)
public FixedWidthWriter addFields(int... width)
public FixedWidthWriter addField(int width, FixedWidthAlign align, char fillChar)
public FixedWidthWriter setFieldNamesInFirstRow(boolean fieldNamesInFirstRow)
setFieldNamesInFirstRow in class AbstractWriterpublic FixedWidthWriter setDescription(String description)
setDescription in class Endpointpublic FixedWidthWriter setNewLine(String newLine)
LinedTextWritersetNewLine in class LinedTextWriterpublic FixedWidthWriter setAutoCloseWriter(boolean autoCloseWriter)
TextWritersetAutoCloseWriter in class TextWriterpublic FixedWidthWriter setFlushOnWrite(boolean flushOnWrite)
TextWritersetFlushOnWrite 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 LinedTextWriterprotected void assembleLine(Record record, StringBuilder lineBuffer) throws Throwable
assembleLine in class LinedTextWriterThrowableCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.