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 class
protected class
protected class
protected class
protected class
protected class
protected class
protected static interface
protected class
protected class
protected class
protected class
Nested 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 boolean
protected boolean
protected com.google.gson.stream.JsonReader
Fields inherited from class org.vast.swe.fast.AbstractDataParser
INVALID_ARRAY_SIZE_MSG, INVALID_BOOLEAN_MSG, INVALID_CHOICE_MSG, INVALID_DECIMAL_MSG, INVALID_INTEGER_MSG
Fields inherited from class org.vast.swe.fast.DataBlockProcessor
dataComponents, enableSubTree, filter, hasVarSizeArray, processorStack, processorTreeReady, rootProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected DataBlockProcessor.ArrayProcessor
getArrayProcessor
(DataArray array) protected DataBlockProcessor.ArraySizeSupplier
getArraySizeSupplier
(String refId) protected DataBlockProcessor.ChoiceProcessor
getChoiceProcessor
(DataChoice choice) protected DataBlockProcessor.ImplicitSizeProcessor
protected DataBlockProcessor.AtomProcessor
getRangeProcessor
(RangeComponent range) protected DataBlockProcessor.RecordProcessor
getRecordProcessor
(DataRecord record) protected DataBlockProcessor.RecordProcessor
getVectorProcessor
(Vector vect) protected void
init()
protected boolean
moreData()
void
reset()
void
void
setInput
(InputStream is) void
void
void
void
visit
(GeometryData geom) void
void
void
Methods inherited from class org.vast.swe.fast.AbstractDataParser
getDataEncoding, getDataHandler, getErrorHandler, getNextDataBlock, getRawDataHandler, parse, parse, parse, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler, setRenewDataBlock, stop, updateArraySize
Methods inherited from class org.vast.swe.fast.DataBlockProcessor
addToProcessorTree, checkEnabled, getDataComponents, setDataComponentFilter, setDataComponents, setEnabled, visit, visit, visit, visit, visit, visit, visit, visit, visitRange
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
init
in classDataBlockProcessor
- Throws:
IOException
-
setInput
- Throws:
IOException
-
setHasArrayWrapper
public void setHasArrayWrapper() -
parseNextBlock
- Specified by:
parseNextBlock
in interfaceDataStreamParser
- Overrides:
parseNextBlock
in classAbstractDataParser
- Throws:
IOException
-
close
- Throws:
IOException
-
reset
public void reset()- Specified by:
reset
in interfaceDataStreamParser
- Overrides:
reset
in classAbstractDataParser
-
visit
-
visit
-
visit
-
visit
-
visit
-
visit
-
visit
- Specified by:
visit
in interfaceDataComponentVisitor
- Overrides:
visit
in classDataBlockProcessor
-
getRangeProcessor
- Overrides:
getRangeProcessor
in classDataBlockProcessor
-
getRecordProcessor
- Overrides:
getRecordProcessor
in classDataBlockProcessor
-
getVectorProcessor
- Overrides:
getVectorProcessor
in classDataBlockProcessor
-
getChoiceProcessor
- Specified by:
getChoiceProcessor
in classDataBlockProcessor
-
getArrayProcessor
- Overrides:
getArrayProcessor
in classDataBlockProcessor
-
getImplicitSizeProcessor
- Specified by:
getImplicitSizeProcessor
in classDataBlockProcessor
-
getArraySizeSupplier
- Specified by:
getArraySizeSupplier
in classDataBlockProcessor
-
moreData
- Specified by:
moreData
in classAbstractDataParser
- Throws:
IOException
-