|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanReaderContext
When a BeanReaderException is thrown, all errors and the current state of the BeanReader can be accessed from the BeanReaderContext. Depending on the type of exception, some information may be missing.
BeanReaderException
Method Summary | |
---|---|
Map<String,Collection<String>> |
getFieldErrors()
Returns a Map of all field errors, where the Map key is the field name. |
Collection<String> |
getFieldErrors(String fieldName)
Returns the field errors for a given field. |
String |
getFieldText(String fieldName)
Returns the unparsed text of a field from the record. |
String |
getFieldText(String fieldName,
int index)
Returns the unparsed text of a field from the record. |
Collection<String> |
getRecordErrors()
Returns the collection of record level error messages. |
int |
getRecordLineNumber()
Returns the line number of the failed record, or 0 if the stream does not use new lines to terminate records. |
String |
getRecordName()
Returns the name of the record from the stream configuration. |
String |
getRecordText()
Returns the raw text of the record being parsed, or null if not supported by the input stream format (such as XML). |
boolean |
hasFieldErrors()
Returns true if there are one or more field level errors. |
boolean |
hasRecordErrors()
Returns true if there are one or more record level errors. |
Method Detail |
---|
int getRecordLineNumber()
String getRecordText()
String getRecordName()
boolean hasRecordErrors()
Collection<String> getRecordErrors()
String getFieldText(String fieldName)
If the field is a collection, this method returns the field text for the first occurrence of the field.
fieldName
- the name of the field to get the text for
String getFieldText(String fieldName, int index)
fieldName
- the name of the field to get the text forindex
- the index of the field, beginning at 0, for collection type
fields
boolean hasFieldErrors()
Map<String,Collection<String>> getFieldErrors()
Collection<String> getFieldErrors(String fieldName)
fieldName
- the name of the field
|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |