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
AMarshallingContext
for 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 void
clear()
Clear is invoked after each bean object (record or group) is marshalled.java.lang.Object
getRecordObject()
Returns the record object to pass to theRecordWriter
whenMarshallingContext.writeRecord()
is called.void
setField(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:MarshallingContext
Clear is invoked after each bean object (record or group) is marshalled.- Overrides:
clear
in 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:MarshallingContext
Returns the record object to pass to theRecordWriter
whenMarshallingContext.writeRecord()
is called.- Specified by:
getRecordObject
in classMarshallingContext
- Returns:
- the record object
-
toArray
public java.lang.String[] toArray(java.lang.Object record)
Description copied from class:MarshallingContext
Converts a record object to aString[]
.- Overrides:
toArray
in classMarshallingContext
- Parameters:
record
- the record object to convert- Returns:
- the
String
array result, or null if not supported
-
toList
public java.util.List<java.lang.String> toList(java.lang.Object record)
Description copied from class:MarshallingContext
Converts a record object to aList
.- Overrides:
toList
in classMarshallingContext
- Parameters:
record
- the record object to convert- Returns:
- the
List
result, or null if not supported
-
-