Class DelimitedMarshallingContext
- java.lang.Object
-
- org.beanio.internal.parser.ParsingContext
-
- org.beanio.internal.parser.MarshallingContext
-
- org.beanio.internal.parser.format.delimited.DelimitedMarshallingContext
-
public class DelimitedMarshallingContext extends MarshallingContext
AMarshallingContextfor delimited records.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
-
-
Constructor Summary
Constructors Constructor Description DelimitedMarshallingContext()
-
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.voidsetField(int position, java.lang.String fieldText, boolean commit)Puts the field text in the record.java.lang.String[]toArray(java.lang.Object record)Converts a record object to aString[].java.util.List<java.lang.String>toList(java.lang.Object record)Converts a record object to aList.-
Methods inherited from class org.beanio.internal.parser.MarshallingContext
getBean, getComponentName, getMode, getRecordWriter, getTextLengthCounter, setBean, setComponentName, setRecordWriter, toDocument, 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
-
setField
public void setField(int position, java.lang.String fieldText, boolean commit)Puts the field text in the record.- Parameters:
position- the position of the field in the record.fieldText- the field textcommit- 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 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
-
toArray
public java.lang.String[] toArray(java.lang.Object record)
Description copied from class:MarshallingContextConverts a record object to aString[].- Overrides:
toArrayin classMarshallingContext- Parameters:
record- the record object to convert- Returns:
- the
Stringarray result, or null if not supported
-
toList
public java.util.List<java.lang.String> toList(java.lang.Object record)
Description copied from class:MarshallingContextConverts a record object to aList.- Overrides:
toListin classMarshallingContext- Parameters:
record- the record object to convert- Returns:
- the
Listresult, or null if not supported
-
-