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
ResultException
public void close() throws ResultException
ResultReader
close
in interface ResultReader
ResultException
public double getDouble() throws ResultException
ResultReader
getDouble
in interface ResultReader
ResultException
public int getIndex()
ResultReader
getIndex
in interface ResultReader
public long getLong() throws ResultException
ResultReader
getLong
in interface ResultReader
ResultException
public java.lang.String getName()
ResultReader
null
is returned.getName
in interface ResultReader
null
public java.lang.String getString()
ResultReader
getString
in interface ResultReader
public java.lang.String getTypeName()
ResultReader
getTypeName
in interface ResultReader
public java.lang.String getValue()
ResultReader
getValue
in interface ResultReader
public boolean hasNext()
ResultReader
Calling ResultReader.next()
after this mehtod returned false
will
result in an exception.
hasNext
in interface ResultReader
public ResultReader.Event next() throws ResultException
ResultReader
next
in interface ResultReader
ResultException
public void readStartResults() throws ResultException
ResultReader
readStartResults
in interface ResultReader
ResultException
public void readEndResults() throws ResultException
ResultReader
readEndResults
in interface ResultReader
ResultException
public void readEndArrayItem() throws ResultException
ResultReader
readEndArrayItem
in interface ResultReader
ResultException
public void readEndNode() throws ResultException
ResultReader
readEndNode
in interface ResultReader
ResultException
public void readStartNode() throws ResultException
ResultReader
readStartNode
in interface ResultReader
ResultException
public void readStartNode(java.lang.String expectedType, java.lang.String expectedName) throws ResultException
ResultReader
readStartNode
in interface ResultReader
expectedType
- the expected type nameexpectedName
- the expected nameResultException
public void readStartNode(java.lang.String expectedType) throws ResultException
ResultReader
readStartNode
in interface ResultReader
expectedType
- the expected type nameResultException
public void readEndArray() throws ResultException
ResultReader
readEndArray
in interface ResultReader
ResultException
public void readStartArray() throws ResultException
ResultReader
readStartArray
in interface ResultReader
ResultException
public ResultReader.Event nextResult() throws ResultException
ResultReader
nextResult
in interface ResultReader
ResultReader.Event.RESULT
, ResultReader.Event.START_NODE
or
ResultReader.Event.START_ARRAY
ResultException
public int readStartArrayItem() throws ResultException
ResultReader
readStartArrayItem
in interface ResultReader
ResultException
public double readDouble(java.lang.String expectedName) throws ResultException
ResultReader
nextResult(); getDouble();
readDouble
in interface ResultReader
ResultException
public long readLong(java.lang.String expectedName) throws ResultException
ResultReader
nextResult(); getLong();
readLong
in interface ResultReader
ResultException
public java.lang.String readString(java.lang.String expectedName) throws ResultException
ResultReader
nextResult(); getString();
readString
in interface ResultReader
ResultException