public class FixedWidthReader extends TextReader
DataEndpoint.State
EOF, reader
currentRecord, fieldNames, lastRow, startingRow
fieldLineage, recordLineage
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
FixedWidthReader(File file) |
FixedWidthReader(Reader reader) |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
FixedWidthReader |
addField(FixedWidthField field) |
FixedWidthReader |
addField(String name,
int width) |
FixedWidthReader |
addField(String name,
int width,
FixedWidthAlign align,
char fillChar) |
FixedWidthReader |
addFields(int... width) |
protected Record |
addLineage(Record record) |
protected boolean |
fillRecord(Record record) |
char |
getFillChar() |
boolean |
isLastFieldConsumesRemaining() |
boolean |
isLineageSupported() |
void |
open()
Makes this endpoint ready for reading or writing.
|
FixedWidthReader |
setDescription(String description) |
FixedWidthReader |
setFieldNames(Collection<String> fieldNames) |
FixedWidthReader |
setFieldNames(String... fieldNames) |
FixedWidthReader |
setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) |
FixedWidthReader |
setFillChar(char fillChar) |
FixedWidthReader |
setLastFieldConsumesRemaining(boolean lastFieldConsumesRemaining)
Set whether the last field in each record will contain the rest of each line.
|
FixedWidthReader |
setLastRow(int lastRow) |
FixedWidthReader |
setSaveLineage(boolean saveLineage) |
FixedWidthReader |
setSkipEmptyRows(boolean skipEmptyRows)
Indicates that rows with only null values should not be returned by the reader (default is false).
|
FixedWidthReader |
setStartingRow(int startingRow) |
FixedWidthReader |
skipField(int width) |
available, close, getFile, getLineNumber, readImpl
getFieldNames, getLastRow, getStartingRow, isFieldNamesInFirstRow, isSkipEmptyRows, read
getBufferSize, getNestedEndpoint, getNestedReader, getRootEndpoint, getRootReader, isExhausted, isSaveLineage, peek, pop, push, skip
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
public FixedWidthReader(File file)
public FixedWidthReader(Reader reader)
public char getFillChar()
public FixedWidthReader setFillChar(char fillChar)
public boolean isLastFieldConsumesRemaining()
public FixedWidthReader setLastFieldConsumesRemaining(boolean lastFieldConsumesRemaining)
false
.public FixedWidthReader addField(FixedWidthField field)
public FixedWidthReader addFields(int... width)
public FixedWidthReader addField(String name, int width)
public FixedWidthReader addField(String name, int width, FixedWidthAlign align, char fillChar)
public FixedWidthReader skipField(int width)
public FixedWidthReader setFieldNamesInFirstRow(boolean fieldNamesInFirstRow)
setFieldNamesInFirstRow
in class AbstractReader
public FixedWidthReader setFieldNames(String... fieldNames)
setFieldNames
in class AbstractReader
public FixedWidthReader setFieldNames(Collection<String> fieldNames)
setFieldNames
in class AbstractReader
public FixedWidthReader setStartingRow(int startingRow)
setStartingRow
in class AbstractReader
public FixedWidthReader setLastRow(int lastRow)
setLastRow
in class AbstractReader
public FixedWidthReader setSkipEmptyRows(boolean skipEmptyRows)
AbstractReader
setSkipEmptyRows
in class AbstractReader
public FixedWidthReader setSaveLineage(boolean saveLineage)
setSaveLineage
in class DataReader
public FixedWidthReader setDescription(String description)
setDescription
in class Endpoint
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 TextReader
public void open() throws DataException
DataEndpoint
open
in class TextReader
DataException
protected boolean fillRecord(Record record) throws Throwable
fillRecord
in class AbstractReader
Throwable
public boolean isLineageSupported()
isLineageSupported
in class DataReader
protected Record addLineage(Record record)
addLineage
in class TextReader
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.