Class JsonMarshallingContext
- java.lang.Object
-
- org.beanio.internal.parser.ParsingContext
-
- org.beanio.internal.parser.MarshallingContext
-
- org.beanio.internal.parser.format.json.JsonMarshallingContext
-
public class JsonMarshallingContext extends MarshallingContext
AMarshallingContextfor JSON formatted streams.- Since:
- 2.0
-
-
Field Summary
-
Fields inherited from class org.beanio.internal.parser.ParsingContext
MARSHALLING, UNMARSHALLING
-
-
Constructor Summary
Constructors Constructor Description JsonMarshallingContext(int maxDepth)Constructs a newJsonMarshallingContext.
-
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.protected java.lang.ObjectgetRecordObject()Returns the record object to pass to theRecordWriterwhenMarshallingContext.writeRecord()is called.voidpop()voidpush(JsonNode type)voidput(JsonNode type, java.lang.Object value)-
Methods inherited from class org.beanio.internal.parser.MarshallingContext
getBean, getComponentName, getMode, getRecordWriter, getTextLengthCounter, setBean, setComponentName, setRecordWriter, toArray, toDocument, toList, writeRecord
-
Methods inherited from class org.beanio.internal.parser.ParsingContext
createHeap, getAdjustedFieldPosition, getLocal, getRelativeFieldIndex, isRepeating, popIteration, pushIteration, setLocal
-
-
-
-
Constructor Detail
-
JsonMarshallingContext
public JsonMarshallingContext(int maxDepth)
Constructs a newJsonMarshallingContext.- Parameters:
maxDepth- the maximum depth of the allJsonWrappercomponents in the parser tree layout.
-
-
Method Detail
-
getRecordObject
protected 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
-
clear
public void clear()
Description copied from class:MarshallingContextClear is invoked after each bean object (record or group) is marshalled.- Overrides:
clearin classMarshallingContext
-
push
public void push(JsonNode type)
- Parameters:
type-
-
pop
public void pop()
-
put
public void put(JsonNode type, java.lang.Object value)
- Parameters:
type-value-
-
-