BeanIO 2.0.4

org.beanio.internal.parser.format.delimited
Class DelimitedUnmarshallingContext

java.lang.Object
  extended by org.beanio.internal.parser.ParsingContext
      extended by org.beanio.internal.parser.UnmarshallingContext
          extended by org.beanio.internal.parser.format.delimited.DelimitedUnmarshallingContext

public class DelimitedUnmarshallingContext
extends UnmarshallingContext

An UnmarshallingContext for a delimited record.

The record value type for a delimited record is a String array.

Since:
2.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
 
Constructor Summary
DelimitedUnmarshallingContext()
          Constructs a new DelimitedUnmarshallingContext.
 
Method Summary
 int getFieldCount()
          Returns the number of fields read from the input stream.
 String getFieldText(String fieldName, int position, int until)
          Returns the field text at the given position in the record.
 void setRecordValue(Object value)
          Sets the value of the record returned from the RecordReader
 Object toRecordValue(List<String> list)
          Converts a List to a record value.
 Object toRecordValue(String[] array)
          Converts a String[] to a record value.
 
Methods inherited from class org.beanio.internal.parser.UnmarshallingContext
addFieldError, addRecordError, addRecordError, getLineNumber, getLocale, getMessageFactory, getMode, getRecordContext, getRecordCount, getRecordReader, 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
createHeap, getAdjustedFieldPosition, getLocal, getRelativeFieldIndex, isRepeating, popIteration, pushIteration, setLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedUnmarshallingContext

public DelimitedUnmarshallingContext()
Constructs a new DelimitedUnmarshallingContext.

Method Detail

setRecordValue

public void setRecordValue(Object value)
Description copied from class: UnmarshallingContext
Sets the value of the record returned from the RecordReader

Specified by:
setRecordValue in class UnmarshallingContext
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 String getFieldText(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 record
until - 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 Object toRecordValue(String[] array)
Description copied from class: UnmarshallingContext
Converts a String[] to a record value.

Overrides:
toRecordValue in class UnmarshallingContext
Parameters:
array - the String[] to convert
Returns:
the record value, or null if not supported

toRecordValue

public Object toRecordValue(List<String> list)
Description copied from class: UnmarshallingContext
Converts a List to a record value.

Overrides:
toRecordValue in class UnmarshallingContext
Parameters:
list - the List to convert
Returns:
the record value, or null if not supported

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim