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 booleanprotected charprotected Stringprotected InputStreamprotected StringBufferprotected char[]protected intFields inherited from class org.vast.swe.AbstractDataParser
CHOICE_ERROR, dataTypeUtils, renewDataBlock, stopParsing, STREAM_ERRORFields 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 TypeMethodDescriptionvoidclose()protected booleanmoreData()Checks if more data is available from the streamvoidparse(InputStream inputStream) Start parsing data coming from the given streamprotected voidparseToken(ScalarComponent component, String token, char decimalSep) Parse a token from a tuple depending on the corresponding Data Component Definitionprotected voidprocessAtom(ScalarComponent component) Processes a scalar componentprotected booleanprocessBlock(DataComponent component) Processes an aggregate componentvoidsetInput(InputStream inputStream) Methods inherited from class org.vast.swe.AbstractDataParser
parse, parse, parseNextBlock, reset, setDataComponents, setRenewDataBlock, stopMethods inherited from class org.vast.swe.DataTreeVisitor
endDataBlock, getDataComponents, getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, isEndOfDataBlock, processNextElement, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandlerMethods 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, 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:
moreDatain classAbstractDataParser- Returns:
- true if more data needs to be parsed, false otherwise
- Throws:
IOException
-
processAtom
Description copied from class:DataTreeVisitorProcesses a scalar component- Specified by:
processAtomin 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:DataTreeVisitorProcesses an aggregate component- Specified by:
processBlockin classDataTreeVisitor- Returns:
- true if children should be processed, false otherwise
- Throws:
IOException
-
close
- Throws:
IOException
-