public abstract class AbstractDataReader extends Object implements DataReader
DataReader
interface with the following features:
DataReader
interface (an IllegalStateException
thrown on error).0
(e.g readBoolean
calls readBoolean0
). Methods can throw any kind of exceptions that will be wrapped into an IOException
.end()
method is called when the data is terminated.Constructor and Description |
---|
AbstractDataReader() |
Modifier and Type | Method and Description |
---|---|
void |
end()
This method is called when the data has been fully read, giving
a "finalization" hook to the implementation.
|
boolean |
hasMoreElements()
Tells whether the current collection has more elements.
|
protected abstract boolean |
hasMoreElements0() |
void |
readArrayValueEnd()
Reads the end of an array value.
|
protected abstract void |
readArrayValueEnd0() |
void |
readArrayValueStart()
Reads the beginning of an array value.
|
protected abstract void |
readArrayValueStart0() |
boolean |
readBooleanValue()
Reads the next expected boolean value.
|
protected abstract boolean |
readBooleanValue0() |
double |
readDoubleValue()
Reads the next expected double precision floating point value (64bits).
|
protected abstract double |
readDoubleValue0() |
int |
readIntKey()
Reads the next expected integer key (signed 32bits) within the current map.
|
protected abstract int |
readIntKey0() |
int |
readIntValue()
Reads the next expected integer value (signed 32bits).
|
protected abstract int |
readIntValue0() |
long |
readLongValue()
Reads the next expected long integer value (signed 64bits).
|
protected abstract long |
readLongValue0() |
void |
readMapValueEnd()
Reads the end of a map value.
|
protected abstract void |
readMapValueEnd0() |
void |
readMapValueStart()
Reads the beginning of a map value.
|
protected abstract void |
readMapValueStart0() |
String |
readStringKey()
Reads the next expected
String key within the current map. |
protected abstract String |
readStringKey0() |
String |
readStringValue()
Reads the next expected
String value. |
protected abstract String |
readStringValue0() |
void |
skipValue()
Skip the next value.
|
protected abstract void |
skipValue0() |
public void end() throws IOException
IOException
- on I/O error.public final boolean hasMoreElements() throws IOException
DataReader
hasMoreElements
in interface DataReader
IOException
- on I/O error.public final void readArrayValueEnd() throws IOException
DataReader
readArrayValueEnd
in interface DataReader
IOException
- on I/O error.public final void readArrayValueStart() throws IOException
DataReader
readArrayValueStart
in interface DataReader
IOException
- on I/O error.protected abstract void readArrayValueStart0() throws Throwable
Throwable
public final boolean readBooleanValue() throws IOException
DataReader
readBooleanValue
in interface DataReader
IOException
- on I/O error.public final double readDoubleValue() throws IOException
DataReader
readDoubleValue
in interface DataReader
IOException
- on I/O error.public final int readIntKey() throws IOException
DataReader
readIntKey
in interface DataReader
IOException
- on I/O error.public final int readIntValue() throws IOException
DataReader
readIntValue
in interface DataReader
IOException
- on I/O error.public final long readLongValue() throws IOException
DataReader
readLongValue
in interface DataReader
IOException
- on I/O error.public final void readMapValueEnd() throws IOException
DataReader
readMapValueEnd
in interface DataReader
IOException
- on I/O error.public final void readMapValueStart() throws IOException
DataReader
readMapValueStart
in interface DataReader
IOException
- on I/O error.public final String readStringKey() throws IOException
DataReader
String
key within the current map.readStringKey
in interface DataReader
IOException
- on I/O error.public final String readStringValue() throws IOException
DataReader
String
value.readStringValue
in interface DataReader
IOException
- on I/O error.public final void skipValue() throws IOException
DataReader
skipValue
in interface DataReader
IOException
- on I/O error.