BeanIO 2.0.4

org.beanio.internal.parser.format.fixedlength
Class FixedLengthMarshallingContext

java.lang.Object
  extended by org.beanio.internal.parser.ParsingContext
      extended by org.beanio.internal.parser.MarshallingContext
          extended by org.beanio.internal.parser.format.fixedlength.FixedLengthMarshallingContext

public class FixedLengthMarshallingContext
extends MarshallingContext

A MarshallingContext for a fixed length formatted stream.

Since:
2.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
 
Constructor Summary
FixedLengthMarshallingContext()
          Constructs a new FixedLengthMarshallingContext.
 
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 setFieldText(int position, String text, boolean commit)
          Inserts field text into the record being marshalled.
 
Methods inherited from class org.beanio.internal.parser.MarshallingContext
getBean, getComponentName, getMode, getRecordWriter, setBean, setComponentName, setRecordWriter, toArray, toDocument, toList, 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

FixedLengthMarshallingContext

public FixedLengthMarshallingContext()
Constructs a new FixedLengthMarshallingContext.

Method Detail

clear

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

Overrides:
clear in class MarshallingContext

setFieldText

public void setFieldText(int position,
                         String text,
                         boolean commit)
Inserts field text into the record being marshalled.

Parameters:
position - the position of the field in the record
text - the field text to insert
commit - true to commit the current field length, or false if the field is optional and should not extend the record length unless a subsequent field is 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

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim