public class XMLResultReader extends java.lang.Object implements ResultReader
ResultReader.Event| Constructor and Description |
|---|
XMLResultReader(java.io.InputStream input,
java.lang.String fileNameForErrorMessages) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the reader and underlying streams.
|
double |
getDouble()
Returns the current double result.
|
long |
getIndex()
Returns the index of the current result element.
|
long |
getLong()
Returns the current long integer result.
|
java.lang.String |
getName()
Returns the name of the current result.
|
java.lang.String |
getString()
Returns the current string result.
|
java.lang.String |
getTypeName()
Returns the type of the current result.
|
java.lang.String |
getValue()
Reads the unparsed value of the current result from the input.
|
boolean |
hasNext()
Returns whether any read events remain or the result tree has been fully
traversed.
|
ResultReader.Event |
next()
Returns the next result read event.
|
ResultReader.Event |
nextResult()
Reads the next result (item, node or array).
|
double |
readDouble(java.lang.String expectedName)
Reads the next double result from the input.
|
void |
readEndArray()
Reads the end of the current result array.
|
void |
readEndArrayItem()
Reads the end of the current array element.
|
void |
readEndNode()
Reads the end of the current result node.
|
void |
readEndResults()
Reads the end of the result tree.
|
long |
readLong(java.lang.String expectedName)
Reads the next long integer result from the input.
|
void |
readStartArray(java.lang.String expectedName)
Reads the next result array.
|
long |
readStartArrayItem(long expectedIndex)
Reads the next array element.
|
void |
readStartNode(java.lang.String expectedType,
java.lang.String expectedName)
Reads the next result node.
|
void |
readStartResults()
Reads the start of the result tree.
|
java.lang.String |
readString(java.lang.String expectedName)
Reads the next string result from the input.
|
public XMLResultReader(java.io.InputStream input,
java.lang.String fileNameForErrorMessages)
throws ImportException
ImportExceptionpublic void close()
throws ImportException
ResultReaderclose in interface ResultReaderImportExceptionpublic double getDouble()
throws ImportException
ResultReadergetDouble in interface ResultReaderImportExceptionpublic long getIndex()
throws ImportException
ResultReadergetIndex in interface ResultReaderImportExceptionpublic long getLong()
throws ImportException
ResultReadergetLong in interface ResultReaderImportExceptionpublic java.lang.String getName()
throws ImportException
ResultReadernull is returned.getName in interface ResultReadernullImportExceptionpublic java.lang.String getString()
throws ImportException
ResultReadergetString in interface ResultReaderImportExceptionpublic java.lang.String getTypeName()
throws ImportException
ResultReadergetTypeName in interface ResultReaderImportExceptionpublic java.lang.String getValue()
throws ImportException
ResultReadergetValue in interface ResultReaderImportExceptionpublic boolean hasNext()
ResultReader
Calling ResultReader.next() after this mehtod returned false will
result in an exception.
hasNext in interface ResultReaderpublic ResultReader.Event next() throws ImportException
ResultReadernext in interface ResultReaderImportExceptionpublic void readStartResults()
throws ImportException
ResultReaderreadStartResults in interface ResultReaderImportExceptionpublic void readEndResults()
throws ImportException
ResultReaderreadEndResults in interface ResultReaderImportExceptionpublic void readEndArrayItem()
throws ImportException
ResultReaderreadEndArrayItem in interface ResultReaderImportExceptionpublic void readEndNode()
throws ImportException
ResultReaderreadEndNode in interface ResultReaderImportExceptionpublic void readStartNode(java.lang.String expectedType,
java.lang.String expectedName)
throws ImportException
ResultReaderreadStartNode in interface ResultReaderexpectedType - the expected type nameexpectedName - the expected nameImportExceptionpublic void readEndArray()
throws ImportException
ResultReaderreadEndArray in interface ResultReaderImportExceptionpublic void readStartArray(java.lang.String expectedName)
throws ImportException
ResultReaderreadStartArray in interface ResultReaderexpectedName - the expected nameImportExceptionpublic ResultReader.Event nextResult() throws ImportException
ResultReadernextResult in interface ResultReaderResultReader.Event.RESULT, ResultReader.Event.START_NODE or
ResultReader.Event.START_ARRAYImportExceptionpublic long readStartArrayItem(long expectedIndex)
throws ImportException
ResultReaderreadStartArrayItem in interface ResultReaderexpectedIndex - the expected index (to be compared with the index read from the
result file)ImportExceptionpublic double readDouble(java.lang.String expectedName)
throws ImportException
ResultReadernextResult(); getDouble();
readDouble in interface ResultReaderImportExceptionpublic long readLong(java.lang.String expectedName)
throws ImportException
ResultReadernextResult(); getLong();
readLong in interface ResultReaderImportExceptionpublic java.lang.String readString(java.lang.String expectedName)
throws ImportException
ResultReadernextResult(); getString();
readString in interface ResultReaderImportException