|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.internal.parser.BeanReaderImpl
public class BeanReaderImpl
A BeanReader
implementation.
Constructor Summary | |
---|---|
BeanReaderImpl(UnmarshallingContext context,
Selector layout)
Constructs a new BeanReaderImpl. |
Method Summary | |
---|---|
void |
close()
Closes the underlying input stream. |
int |
getLineNumber()
Returns the starting line number of the first record for the most recent bean object read from this reader, or -1 when the end of the stream is reached. |
RecordContext |
getRecordContext(int index)
Returns record information for the most recent bean object read from this reader. |
int |
getRecordCount()
Returns the number of records read from the underlying input stream for the most recent bean object read from this reader. |
String |
getRecordName()
Returns the record or group name of the most recent bean object read from this reader, or null if the end of the stream was reached. |
Object |
read()
Reads a single bean from the input stream. |
void |
setErrorHandler(BeanReaderErrorHandler errorHandler)
Sets the error handler to handle exceptions thrown by BeanReader.read() . |
void |
setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
Sets whether to ignore unidentified records. |
int |
skip(int count)
Skips ahead in the input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanReaderImpl(UnmarshallingContext context, Selector layout)
context
- the UnmarshallingContext
layout
- the root component of the parser treeMethod Detail |
---|
public Object read()
BeanReader
read
in interface BeanReader
public int skip(int count) throws BeanReaderIOException, MalformedRecordException, UnidentifiedRecordException, UnexpectedRecordException
BeanReader
skip
in interface BeanReader
count
- the number of bean objects to skip over that would have been returned
by calling BeanReader.read()
BeanReaderIOException
- if the underlying input stream throws an
IOException
or this reader was closed
MalformedRecordException
- if the underlying input stream is malformed
and a record could not be accurately skipped
UnidentifiedRecordException
- if a record could not be identified
UnexpectedRecordException
- if a record is out of sequencepublic void close() throws BeanReaderIOException
BeanReader
close
in interface BeanReader
BeanReaderIOException
- if the underlying input stream throws an
IOException
or this reader was already closedpublic String getRecordName()
BeanReader
getRecordName
in interface BeanReader
public int getLineNumber()
BeanReader
getLineNumber
in interface BeanReader
public int getRecordCount()
BeanReader
getRecordCount
in interface BeanReader
public RecordContext getRecordContext(int index)
BeanReader
BeanReader.getRecordCount()
can be used
to determine how many records were read from the stream.
getRecordContext
in interface BeanReader
index
- the index of the record, starting at 0
RecordContext
BeanReader.getRecordCount()
public void setErrorHandler(BeanReaderErrorHandler errorHandler)
BeanReader
BeanReader.read()
.
setErrorHandler
in interface BeanReader
errorHandler
- the BeanReaderErrorHandler
public void setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
ignoreUnidentifiedRecords
- true to ignore unidentified records, false otherwise
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |