|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.internal.parser.ErrorContext
public class ErrorContext
| Constructor Summary | |
|---|---|
ErrorContext()
Constructs a new ErrorContext. |
|
| Method Summary | |
|---|---|
void |
addFieldError(String fieldName,
String message)
Adds a field error message. |
void |
addRecordError(String message)
Adds a record level error message. |
void |
clear()
Clears this context; |
int |
getFieldCount(String fieldName)
Returns the number of times the given field was present in the stream. |
Map<String,Collection<String>> |
getFieldErrors()
Returns a Map of all field errors. |
Collection<String> |
getFieldErrors(String fieldName)
Returns the field errors for a given field. |
String |
getFieldText(String fieldName)
Returns the raw text of a field found in this record. |
String |
getFieldText(String fieldName,
int index)
Returns the raw text of a field found in this record. |
int |
getLineNumber()
Returns the line number of this record, or 0 if the stream does not use new lines to terminate records. |
Collection<String> |
getRecordErrors()
Returns a collection of record level error messages. |
int |
getRecordLineNumber()
Returns the starting line number of the last record read from the record reader. |
String |
getRecordName()
Returns the name of the last record read from the record reader, or null if not known. |
String |
getRecordText()
Returns the raw text of the last record read from the record reader. |
boolean |
hasErrors()
Returns whether this record has any record or field level errors. |
boolean |
hasFieldErrors()
Returns whether there are one or more field level errors. |
boolean |
hasRecordErrors()
Returns whether there are one or more record level errors. |
void |
setFieldText(String fieldName,
String text,
boolean repeating)
Sets the raw field text for a named field. |
void |
setLineNumber(int lineNumber)
Sets the starting line number of the last record read from the record reader. |
void |
setRecordName(String recordName)
Sets the name of the last record read from the record reader. |
void |
setRecordText(String text)
Sets the raw text of the last record read from the record reader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ErrorContext()
| Method Detail |
|---|
public void clear()
public String getRecordText()
getRecordText in interface RecordContextpublic void setRecordText(String text)
text - the raw text of the last record readpublic int getRecordLineNumber()
getRecordLineNumber in interface RecordContextpublic void setLineNumber(int lineNumber)
lineNumber - the line number of the last recordpublic String getRecordName()
getRecordName in interface RecordContextpublic void setRecordName(String recordName)
recordName - the record name
public void addFieldError(String fieldName,
String message)
fieldName - the name of the fieldmessage - the error message to addpublic void addRecordError(String message)
message - the error message to add
public void setFieldText(String fieldName,
String text,
boolean repeating)
fieldName - the name of the fieldtext - the raw field textrepeating - whether the field repeats in the streampublic boolean hasErrors()
RecordContext
hasErrors in interface RecordContextpublic boolean hasRecordErrors()
RecordContext
hasRecordErrors in interface RecordContextpublic Collection<String> getRecordErrors()
RecordContext
getRecordErrors in interface RecordContextCollection of record level error messagespublic int getFieldCount(String fieldName)
RecordContext
getFieldCount in interface RecordContextfieldName - the name of the field
public String getFieldText(String fieldName)
RecordContextIf the field repeats in the stream, this method returns the field text for the first occurrence of the field.
getFieldText in interface RecordContextfieldName - the name of the field
public String getFieldText(String fieldName,
int index)
RecordContext
getFieldText in interface RecordContextfieldName - the name of the field to get the text forindex - the index of the field (beginning at 0), for repeating fields
public boolean hasFieldErrors()
RecordContext
hasFieldErrors in interface RecordContextpublic Map<String,Collection<String>> getFieldErrors()
RecordContextMap of all field errors. The name of the field is used for the
Map key, and the value is a Collection of field error messages.
getFieldErrors in interface RecordContextMap of all field errorspublic Collection<String> getFieldErrors(String fieldName)
RecordContext
getFieldErrors in interface RecordContextfieldName - the name of the field
Collection of field errors, or null if no errors were
reported for the fieldpublic int getLineNumber()
RecordContext
getLineNumber in interface RecordContext
|
BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||