Class FixedLengthMarshallingContext
- java.lang.Object
-
- org.beanio.internal.parser.ParsingContext
-
- org.beanio.internal.parser.MarshallingContext
-
- org.beanio.internal.parser.format.fixedlength.FixedLengthMarshallingContext
-
public class FixedLengthMarshallingContext extends MarshallingContext
AMarshallingContextfor a fixed length formatted stream.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
-
-
Constructor Summary
Constructors Constructor Description FixedLengthMarshallingContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear is invoked after each bean object (record or group) is marshalled.java.lang.ObjectgetRecordObject()Returns the record object to pass to theRecordWriterwhenMarshallingContext.writeRecord()is called.TextLengthCountergetTextLengthCounter()voidsetFieldText(int position, java.lang.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
-
-
-
-
Method Detail
-
clear
public void clear()
Description copied from class:MarshallingContextClear is invoked after each bean object (record or group) is marshalled.- Overrides:
clearin classMarshallingContext
-
setFieldText
public void setFieldText(int position, java.lang.String text, boolean commit)Inserts field text into the record being marshalled.- Parameters:
position- the position of the field in the recordtext- the field text to insertcommit- 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
-
getTextLengthCounter
public TextLengthCounter getTextLengthCounter()
- Overrides:
getTextLengthCounterin classMarshallingContext
-
getRecordObject
public java.lang.Object getRecordObject()
Description copied from class:MarshallingContextReturns the record object to pass to theRecordWriterwhenMarshallingContext.writeRecord()is called.- Specified by:
getRecordObjectin classMarshallingContext- Returns:
- the record object
-
-