public class AsciiDataParser extends AbstractDataParser
DataTreeVisitor.Record
Modifier and Type | Field and Description |
---|---|
protected char[] |
blockSep |
protected boolean |
collapseWhiteSpaces |
protected char |
decimalSep |
protected String |
lastToken |
protected InputStream |
reader |
protected StringBuffer |
tokenBuf |
protected char[] |
tokenSep |
protected int |
tupleSize |
CHOICE_ERROR, dataTypeUtils, renewDataBlock, stopParsing, STREAM_ERROR
componentStack, currentRecord, dataComponents, dataEncoding, dataHandler, endOfArray, errorHandler, newBlock, parentArray, parentArrayIndex, parsing, rawHandler
Constructor and Description |
---|
AsciiDataParser() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected boolean |
moreData()
Checks if more data is available from the stream
|
void |
parse(InputStream inputStream)
Start parsing data coming from the given stream
|
protected void |
parseToken(ScalarComponent component,
String token,
char decimalSep)
Parse a token from a tuple depending on the corresponding Data Component Definition
|
protected void |
processAtom(ScalarComponent component) |
protected boolean |
processBlock(DataComponent component)
Process an aggregate component
|
void |
setInput(InputStream inputStream) |
parse, parse, parseNextBlock, reset, setDataComponents, setRenewDataBlock, stop
endDataBlock, getDataComponents, getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, isEndOfDataBlock, processNextElement, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataComponents, getDataEncoding, getDataHandler, getErrorHandler, getRawDataHandler, setDataEncoding, setDataHandler, setErrorHandler, setParentArray, setRawDataHandler
protected int tupleSize
protected char[] tokenSep
protected char[] blockSep
protected char decimalSep
protected boolean collapseWhiteSpaces
protected StringBuffer tokenBuf
protected String lastToken
protected InputStream reader
public void setInput(InputStream inputStream) throws IOException
IOException
public void parse(InputStream inputStream) throws IOException
IOException
protected void processAtom(ScalarComponent component) throws IOException
processAtom
in class DataTreeVisitor
IOException
protected boolean moreData() throws IOException
moreData
in class AbstractDataParser
IOException
protected void parseToken(ScalarComponent component, String token, char decimalSep) throws ReaderException
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 dataReaderException
protected boolean processBlock(DataComponent component) throws IOException
DataTreeVisitor
processBlock
in class DataTreeVisitor
IOException
public void close() throws IOException
IOException
Copyright © 2016 Sensia Software LLC. All rights reserved.