BeanIO 2.0.4

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

java.lang.Object
  extended by org.beanio.internal.parser.ParsingContext
      extended by org.beanio.internal.parser.MarshallingContext
          extended by org.beanio.internal.parser.format.delimited.DelimitedMarshallingContext

public class DelimitedMarshallingContext
extends MarshallingContext

A MarshallingContext for delimited records.

Since:
2.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
 
Constructor Summary
DelimitedMarshallingContext()
          Constructs a new DelimitedMarshallingContext.
 
Method Summary
 void clear()
          Clear is invoked after each record is marshalled.
 Object getRecordObject()
          Returns the record object to pass to the RecordWriter when MarshallingContext.writeRecord() is called.
 void setField(int position, String fieldText, boolean commit)
          Puts the field text in the record.
 String[] toArray(Object record)
          Converts a record object to a String[].
 List<String> toList(Object record)
          Converts a record object to a List.
 
Methods inherited from class org.beanio.internal.parser.MarshallingContext
getBean, getComponentName, getMode, getRecordWriter, setBean, setComponentName, setRecordWriter, toDocument, writeRecord
 
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

DelimitedMarshallingContext

public DelimitedMarshallingContext()
Constructs a new DelimitedMarshallingContext.

Method Detail

clear

public void clear()
Description copied from class: MarshallingContext
Clear is invoked after each record is marshalled.

Overrides:
clear in class MarshallingContext

setField

public void setField(int position,
                     String fieldText,
                     boolean commit)
Puts the field text in the record.

Parameters:
position - the position of the field in the record.
fieldText - the field text
commit - true to commit the current record, or false if the field is optional and should not extend the record unless a subsequent field is later appended to the record

getRecordObject

public Object getRecordObject()
Description copied from class: MarshallingContext
Returns the record object to pass to the RecordWriter when MarshallingContext.writeRecord() is called.

Specified by:
getRecordObject in class MarshallingContext
Returns:
the record object

toArray

public String[] toArray(Object record)
Description copied from class: MarshallingContext
Converts a record object to a String[].

Overrides:
toArray in class MarshallingContext
Parameters:
record - the record object to convert
Returns:
the String array result, or null if not supported

toList

public List<String> toList(Object record)
Description copied from class: MarshallingContext
Converts a record object to a List.

Overrides:
toList in class MarshallingContext
Parameters:
record - the record object to convert
Returns:
the List result, or null if not supported

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim