public class XMLResultReader extends java.lang.Object implements ResultReader
ResultReader.Event| Constructor and Description |
|---|
XMLResultReader(java.io.InputStream input) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the reader and underlying streams.
|
double |
getDouble()
Returns the current double result.
|
int |
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()
Reads the next result array.
|
int |
readStartArrayItem()
Reads the next array element.
|
void |
readStartNode()
Reads the next result node.
|
void |
readStartNode(java.lang.String expectedType)
Reads the next result node.
|
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)
throws ResultException
ResultExceptionpublic void close()
throws ResultException
ResultReaderclose in interface ResultReaderResultExceptionpublic double getDouble()
throws ResultException
ResultReadergetDouble in interface ResultReaderResultExceptionpublic int getIndex()
ResultReadergetIndex in interface ResultReaderpublic long getLong()
throws ResultException
ResultReadergetLong in interface ResultReaderResultExceptionpublic java.lang.String getName()
ResultReadernull is returned.getName in interface ResultReadernullpublic java.lang.String getString()
ResultReadergetString in interface ResultReaderpublic java.lang.String getTypeName()
ResultReadergetTypeName in interface ResultReaderpublic java.lang.String getValue()
ResultReadergetValue in interface ResultReaderpublic boolean hasNext()
ResultReader
Calling ResultReader.next() after this mehtod returned false will
result in an exception.
hasNext in interface ResultReaderpublic ResultReader.Event next() throws ResultException
ResultReadernext in interface ResultReaderResultExceptionpublic void readStartResults()
throws ResultException
ResultReaderreadStartResults in interface ResultReaderResultExceptionpublic void readEndResults()
throws ResultException
ResultReaderreadEndResults in interface ResultReaderResultExceptionpublic void readEndArrayItem()
throws ResultException
ResultReaderreadEndArrayItem in interface ResultReaderResultExceptionpublic void readEndNode()
throws ResultException
ResultReaderreadEndNode in interface ResultReaderResultExceptionpublic void readStartNode()
throws ResultException
ResultReaderreadStartNode in interface ResultReaderResultExceptionpublic void readStartNode(java.lang.String expectedType,
java.lang.String expectedName)
throws ResultException
ResultReaderreadStartNode in interface ResultReaderexpectedType - the expected type nameexpectedName - the expected nameResultExceptionpublic void readStartNode(java.lang.String expectedType)
throws ResultException
ResultReaderreadStartNode in interface ResultReaderexpectedType - the expected type nameResultExceptionpublic void readEndArray()
throws ResultException
ResultReaderreadEndArray in interface ResultReaderResultExceptionpublic void readStartArray()
throws ResultException
ResultReaderreadStartArray in interface ResultReaderResultExceptionpublic ResultReader.Event nextResult() throws ResultException
ResultReadernextResult in interface ResultReaderResultReader.Event.RESULT, ResultReader.Event.START_NODE or
ResultReader.Event.START_ARRAYResultExceptionpublic int readStartArrayItem()
throws ResultException
ResultReaderreadStartArrayItem in interface ResultReaderResultExceptionpublic double readDouble(java.lang.String expectedName)
throws ResultException
ResultReadernextResult(); getDouble();
readDouble in interface ResultReaderResultExceptionpublic long readLong(java.lang.String expectedName)
throws ResultException
ResultReadernextResult(); getLong();
readLong in interface ResultReaderResultExceptionpublic java.lang.String readString(java.lang.String expectedName)
throws ResultException
ResultReadernextResult(); getString();
readString in interface ResultReaderResultException