|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.parse.DelimitedRecordReaderTest.TestRecordHandler
Field Summary | |
protected int |
endCount
|
protected int |
errorCount
|
protected String |
lastErrorMsg
|
protected List |
records
|
protected int |
startCount
|
Method Summary | |
void |
end()
this method is called by the record reader after the last record has been read, when the end of the stream is reached. |
void |
error(int recordNumber,
String errorMsg,
String[] rawData)
this method is called by the record reader when it is unable to read a record into a record object. |
Date |
getDateField(int recordNumber,
String fieldName)
|
Object |
getField(int recordNumber,
String fieldName)
|
Number |
getNumberField(int recordNumber,
String fieldName)
|
String |
getStringField(int recordNumber,
String fieldName)
|
boolean |
newRecord(int recordNumber,
RecordData newRecord,
String[] rawData)
this method is called by the reader each time a record is successfully read and loaded into an RecordData object. |
void |
start()
this method is called by the record reader before reading the first record. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int startCount
protected int endCount
protected int errorCount
protected List records
protected String lastErrorMsg
Method Detail |
public Object getField(int recordNumber, String fieldName)
public String getStringField(int recordNumber, String fieldName)
public Date getDateField(int recordNumber, String fieldName)
public Number getNumberField(int recordNumber, String fieldName)
public void start()
InputRecordHandler
start
in interface InputRecordHandler
public boolean newRecord(int recordNumber, RecordData newRecord, String[] rawData) throws RecordDataInputException
InputRecordHandler
RecordData
object. If the raw data cannot be
converted to a record object, the RecordReader will add the record to an edit
(reject) file with an appriate message about the cause. If the record is created
successfully, but the handler throws an RecordDataInputException, the record is added to
the edit stream, along with the information provided in the exception.
newRecord
in interface InputRecordHandler
recordNumber
- sequential number assigned to each record, whether it failed
or succeeded, starting at 1 for the first record in the stream.newRecord
- record object containg data values read for this record.rawData
- text data from input file used to create this record.
RecordDataInputException
- if record handling failed.public void error(int recordNumber, String errorMsg, String[] rawData)
InputRecordHandler
error
in interface InputRecordHandler
recordNumber
- sequential number assigned to each record, whether it failed
or succeeded, starting at 1 for the first record in the stream.errorMsg
- descriprtion of the error that occured.rawData
- text data from the input stream which failed to produce a record.public void end()
InputRecordHandler
end
in interface InputRecordHandler
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |