Package org.vast.swe
Class AsciiDataParser
java.lang.Object
org.vast.swe.DataTreeVisitor
org.vast.swe.AbstractDataParser
org.vast.swe.AsciiDataParser
- All Implemented Interfaces:
DataStreamParser
-
Nested Class Summary
Nested classes/interfaces inherited from class org.vast.swe.DataTreeVisitor
DataTreeVisitor.Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]
protected boolean
protected char
protected String
protected InputStream
protected StringBuffer
protected char[]
protected int
Fields 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 boolean
moreData()
Checks if more data is available from the streamvoid
parse
(InputStream inputStream) Start parsing data coming from the given streamprotected void
parseToken
(ScalarComponent component, String token, char decimalSep) Parse a token from a tuple depending on the corresponding Data Component Definitionprotected void
processAtom
(ScalarComponent component) Processes a scalar componentprotected boolean
processBlock
(DataComponent component) Processes an aggregate componentvoid
setInput
(InputStream inputStream) Methods inherited from class org.vast.swe.AbstractDataParser
parse, parse, parseNextBlock, reset, 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
-
tupleSize
protected int tupleSize -
tokenSep
protected char[] tokenSep -
blockSep
protected char[] blockSep -
decimalSep
protected char decimalSep -
collapseWhiteSpaces
protected boolean collapseWhiteSpaces -
tokenBuf
-
lastToken
-
reader
-
-
Constructor Details
-
AsciiDataParser
public AsciiDataParser()
-
-
Method Details
-
setInput
- Throws:
IOException
-
parse
Start parsing data coming from the given stream- Throws:
IOException
-
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
-
parseToken
protected void parseToken(ScalarComponent component, String token, char decimalSep) throws IOException Parse a token from a tuple depending on the corresponding Data Component Definition- Parameters:
scalarInfo
-token
-decimalSep
- character to be used as the decimal separator. (don't change anything and assume '.' if 0)dataBlock
- the DataBlock to contain the read data- 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
-