Package org.vast.swe.fast
Class JsonDataWriterGson
java.lang.Object
org.vast.swe.fast.DataBlockProcessor
org.vast.swe.fast.AbstractDataWriter
org.vast.swe.fast.JsonDataWriterGson
- All Implemented Interfaces:
 DataComponentVisitor,DataStreamWriter
- Direct Known Subclasses:
 JsonArrayDataWriterGson
New implementation of JSON data writer with better efficiency since the write tree is pre-computed during init instead of being re-evaluated while iterating through the component tree.
This particular implementation is based on Gson JsonWriter.
- Since:
 - Jan 26, 2021
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected static interfaceprotected classprotected classprotected classprotected classprotected classNested classes/interfaces inherited from class org.vast.swe.fast.DataBlockProcessor
DataBlockProcessor.ArrayProcessor, DataBlockProcessor.ArraySizeSupplier, DataBlockProcessor.AtomProcessor, DataBlockProcessor.BaseProcessor, DataBlockProcessor.ChoiceProcessor, DataBlockProcessor.CompositeProcessor, DataBlockProcessor.ImplicitSizeProcessor, DataBlockProcessor.RecordProcessor - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,JsonDataWriterGson.IntegerWriter> protected booleanprotected com.google.gson.stream.JsonWriterFields inherited from class org.vast.swe.fast.AbstractDataWriter
dataEncoding, lastArrayElt, parentArrayFields inherited from class org.vast.swe.fast.DataBlockProcessor
dataComponents, enableSubTree, filter, hasVarSizeArray, processorStack, processorTreeReady, rootProcessor - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidvoidflush()protected DataBlockProcessor.ArrayProcessorgetArrayProcessor(DataArray array) protected DataBlockProcessor.ArraySizeSuppliergetArraySizeSupplier(String refId) protected DataBlockProcessor.ChoiceProcessorgetChoiceProcessor(DataChoice choice) protected DataBlockProcessor.ImplicitSizeProcessorprotected DataBlockProcessor.AtomProcessorgetRangeProcessor(RangeComponent range) protected DataBlockProcessor.RecordProcessorgetRecordProcessor(DataRecord record) protected DataBlockProcessor.RecordProcessorgetVectorProcessor(Vector vect) protected voidinit()voidreset()voidvoidstartStream(boolean addWrapper) voidvoidvoidvoidvisit(GeometryData geom) voidvoidvoidprotected voidwriteInline(boolean writeInline) Methods inherited from class org.vast.swe.fast.AbstractDataWriter
getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler, stop, write, writeMethods inherited from class org.vast.swe.fast.DataBlockProcessor
addToProcessorTree, checkEnabled, getDataComponents, setDataComponentFilter, setDataComponents, setEnabled, visit, visit, visit, visit, visit, visit, visit, visit, visitRangeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vast.cdm.common.DataStreamWriter
getDataComponents, setDataComponents 
- 
Field Details
- 
writer
protected com.google.gson.stream.JsonWriter writer - 
countWriters
 - 
wrapWithJsonArray
protected boolean wrapWithJsonArray 
 - 
 - 
Constructor Details
- 
JsonDataWriterGson
public JsonDataWriterGson() - 
JsonDataWriterGson
public JsonDataWriterGson(com.google.gson.stream.JsonWriter writer)  
 - 
 - 
Method Details
- 
init
protected void init()- Specified by:
 initin classDataBlockProcessor
 - 
setOutput
 - 
writeInline
protected void writeInline(boolean writeInline)  - 
startStream
- Specified by:
 startStreamin interfaceDataStreamWriter- Overrides:
 startStreamin classAbstractDataWriter- Throws:
 IOException
 - 
endStream
- Specified by:
 endStreamin interfaceDataStreamWriter- Overrides:
 endStreamin classAbstractDataWriter- Throws:
 IOException
 - 
flush
- Throws:
 IOException
 - 
close
- Throws:
 IOException
 - 
reset
public void reset()- Specified by:
 resetin interfaceDataStreamWriter- Overrides:
 resetin classAbstractDataWriter
 - 
visit
 - 
visit
 - 
visit
 - 
visit
 - 
visit
 - 
visit
 - 
visit
- Specified by:
 visitin interfaceDataComponentVisitor- Overrides:
 visitin classDataBlockProcessor
 - 
getRangeProcessor
- Overrides:
 getRangeProcessorin classDataBlockProcessor
 - 
getRecordProcessor
- Overrides:
 getRecordProcessorin classDataBlockProcessor
 - 
getVectorProcessor
- Overrides:
 getVectorProcessorin classDataBlockProcessor
 - 
getChoiceProcessor
- Specified by:
 getChoiceProcessorin classDataBlockProcessor
 - 
getArrayProcessor
- Overrides:
 getArrayProcessorin classDataBlockProcessor
 - 
getImplicitSizeProcessor
- Specified by:
 getImplicitSizeProcessorin classDataBlockProcessor
 - 
getArraySizeSupplier
- Specified by:
 getArraySizeSupplierin classDataBlockProcessor
 
 -