Package org.vast.swe.fast
Class JsonDataParserGson
java.lang.Object
org.vast.swe.fast.DataBlockProcessor
org.vast.swe.fast.AbstractDataParser
org.vast.swe.fast.JsonDataParserGson
- All Implemented Interfaces:
 DataComponentVisitor,DataStreamParser
- Direct Known Subclasses:
 JsonArrayDataParserGson
New implementation of JSON data parser with better efficiency since the read tree is pre-computed during init instead of being re-evaluated while iterating through the component tree.
This particular implementation is based on Gson JsonReader.
- Since:
 - Jan 26, 2021
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected classprotected classprotected classprotected classprotected static interfaceprotected 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,JsonDataParserGson.IntegerReader> protected booleanprotected booleanprotected com.google.gson.stream.JsonReaderFields inherited from class org.vast.swe.fast.AbstractDataParser
INVALID_ARRAY_SIZE_MSG, INVALID_BOOLEAN_MSG, INVALID_CHOICE_MSG, INVALID_DECIMAL_MSG, INVALID_INTEGER_MSGFields inherited from class org.vast.swe.fast.DataBlockProcessor
dataComponents, enableSubTree, filter, hasVarSizeArray, processorStack, processorTreeReady, rootProcessor - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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()protected booleanmoreData()voidreset()voidvoidsetInput(InputStream is) voidvoidvoidvoidvisit(GeometryData geom) voidvoidvoidMethods inherited from class org.vast.swe.fast.AbstractDataParser
getDataEncoding, getDataHandler, getErrorHandler, getNextDataBlock, getRawDataHandler, parse, parse, parse, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler, setRenewDataBlock, stop, updateArraySizeMethods 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.DataStreamParser
getDataComponents, setDataComponents 
- 
Field Details
- 
reader
protected com.google.gson.stream.JsonReader reader - 
multipleRecords
protected boolean multipleRecords - 
countReaders
 - 
hasJsonArrayWrapper
protected boolean hasJsonArrayWrapper 
 - 
 - 
Constructor Details
- 
JsonDataParserGson
public JsonDataParserGson() - 
JsonDataParserGson
public JsonDataParserGson(com.google.gson.stream.JsonReader reader)  
 - 
 - 
Method Details
- 
init
- Specified by:
 initin classDataBlockProcessor- Throws:
 IOException
 - 
setInput
- Throws:
 IOException
 - 
setHasArrayWrapper
public void setHasArrayWrapper() - 
parseNextBlock
- Specified by:
 parseNextBlockin interfaceDataStreamParser- Overrides:
 parseNextBlockin classAbstractDataParser- Throws:
 IOException
 - 
close
- Throws:
 IOException
 - 
reset
public void reset()- Specified by:
 resetin interfaceDataStreamParser- Overrides:
 resetin classAbstractDataParser
 - 
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
 - 
moreData
- Specified by:
 moreDatain classAbstractDataParser- Throws:
 IOException
 
 -