Package org.vast.swe
Class BinaryDataParser
java.lang.Object
org.vast.swe.DataTreeVisitor
org.vast.swe.AbstractDataParser
org.vast.swe.BinaryDataParser
- All Implemented Interfaces:
DataStreamParser
Parses CDM binary data stream using the data components structure and the binary encoding information.
- Since:
- Nov 22, 2005
-
Nested Class Summary
Nested classes/interfaces inherited from class org.vast.swe.DataTreeVisitor
DataTreeVisitor.Record
-
Field Summary
FieldsFields inherited from class org.vast.swe.AbstractDataParser
CHOICE_ERROR, dataTypeUtils, renewDataBlock, stopParsing, STREAM_ERROR
Fields inherited from class org.vast.swe.DataTreeVisitor
componentStack, currentRecord, dataComponents, dataEncoding, dataHandler, endOfArray, errorHandler, newBlock, parentArray, parentArrayIndex, parsing, rawHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
initBlockReader
(DataComponent blockComponent, BinaryBlockImpl binaryOpts) boolean
moreData()
Checks if more data is available from the streamparse()
void
parse
(InputStream inputStream) protected void
processAtom
(ScalarComponent scalarComponent) Processes a scalar componentprotected boolean
processBlock
(DataComponent blockComponent) Processes an aggregate componentvoid
reset()
Reset the parser before parsing a new tupleprotected void
Maps a given scalar component to the corresponding BinaryValue object containing binary encoding information.void
setInput
(InputStream inputStream) Methods inherited from class org.vast.swe.AbstractDataParser
parse, parse, parseNextBlock, setDataComponents, setRenewDataBlock, stop
Methods inherited from class org.vast.swe.DataTreeVisitor
endDataBlock, getDataComponents, getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, isEndOfDataBlock, processNextElement, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler
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, getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler
-
Field Details
-
dataInput
-
input
-
componentEncodingResolved
protected boolean componentEncodingResolved
-
-
Constructor Details
-
BinaryDataParser
public BinaryDataParser()
-
-
Method Details
-
setInput
- Throws:
IOException
-
parse
- Throws:
IOException
-
parse
- Throws:
IOException
-
reset
public void reset()Description copied from class:DataTreeVisitor
Reset the parser before parsing a new tuple- Specified by:
reset
in interfaceDataStreamParser
- Overrides:
reset
in classAbstractDataParser
-
resolveComponentEncodings
Maps a given scalar component to the corresponding BinaryValue object containing binary encoding information. This also forces the DataValues primitive type to be the same as the ones specified in the binary encoding section.- Throws:
CDMException
-
initBlockReader
protected void initBlockReader(DataComponent blockComponent, BinaryBlockImpl binaryOpts) throws CDMException - Throws:
CDMException
-
moreData
Checks if more data is available from the stream- Specified by:
moreData
in classAbstractDataParser
- Returns:
- true if more data needs to be parsed, false otherwise
- Throws:
IOException
-
processAtom
Description copied from class:DataTreeVisitor
Processes a scalar component- Specified by:
processAtom
in classDataTreeVisitor
- Throws:
IOException
-
processBlock
Description copied from class:DataTreeVisitor
Processes an aggregate component- Specified by:
processBlock
in classDataTreeVisitor
- Returns:
- true if children should be processed, false otherwise
- Throws:
IOException
-
close
- Throws:
IOException
-