Class DelimitedUnmarshallingContext
- java.lang.Object
-
- org.beanio.internal.parser.ParsingContext
-
- org.beanio.internal.parser.UnmarshallingContext
-
- org.beanio.internal.parser.format.delimited.DelimitedUnmarshallingContext
-
public class DelimitedUnmarshallingContext extends UnmarshallingContext
AnUnmarshallingContext
for a delimited record.The record value type for a delimited record is a
String
array.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
-
-
Constructor Summary
Constructors Constructor Description DelimitedUnmarshallingContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFieldCount()
Returns the number of fields read from the input stream.java.lang.String
getFieldText(java.lang.String fieldName, int position, int until)
Returns the field text at the given position in the record.void
setRecordValue(java.lang.Object value)
Sets the value of the record returned from theRecordReader
java.lang.Object
toRecordValue(java.lang.String[] array)
Converts aString[]
to a record value.java.lang.Object
toRecordValue(java.util.List<java.lang.String> list)
Converts aList
to a record value.-
Methods inherited from class org.beanio.internal.parser.UnmarshallingContext
addFieldError, addRecordError, addRecordError, getLineNumber, getLocale, getMessageFactory, getMode, getRecordContext, getRecordCount, getRecordReader, getTextLengthCounter, hasFieldErrors, hasRecordErrors, isEOF, newMalformedRecordException, newUnsatisfiedGroupException, newUnsatisfiedRecordException, nextRecord, prepare, recordCompleted, recordException, recordSkipped, recordStarted, recordUnexpectedException, recordUnidentifiedException, setFieldText, setLocale, setMessageFactory, setRecordReader, toRecordValue, validate
-
Methods inherited from class org.beanio.internal.parser.ParsingContext
clear, createHeap, getAdjustedFieldPosition, getLocal, getRelativeFieldIndex, isRepeating, popIteration, pushIteration, setLocal
-
-
-
-
Method Detail
-
setRecordValue
public void setRecordValue(java.lang.Object value)
Description copied from class:UnmarshallingContext
Sets the value of the record returned from theRecordReader
- Specified by:
setRecordValue
in classUnmarshallingContext
- Parameters:
value
- the record value read by a record reader- See Also:
RecordReader
-
getFieldCount
public int getFieldCount()
Returns the number of fields read from the input stream.- Returns:
- the number of fields
-
getFieldText
public java.lang.String getFieldText(java.lang.String fieldName, int position, int until)
Returns the field text at the given position in the record.- Parameters:
position
- the position of the field within the recorduntil
- the maximum position of the field as an offset of the field count, for example -2 to indicate the any position except the last two fields in the record- Returns:
- the field text
-
toRecordValue
public java.lang.Object toRecordValue(java.lang.String[] array)
Description copied from class:UnmarshallingContext
Converts aString[]
to a record value.- Overrides:
toRecordValue
in classUnmarshallingContext
- Parameters:
array
- theString[]
to convert- Returns:
- the record value, or null if not supported
-
toRecordValue
public java.lang.Object toRecordValue(java.util.List<java.lang.String> list)
Description copied from class:UnmarshallingContext
Converts aList
to a record value.- Overrides:
toRecordValue
in classUnmarshallingContext
- Parameters:
list
- theList
to convert- Returns:
- the record value, or null if not supported
-
-