public class JsonReader extends Object implements ObjectReader
| Modifier and Type | Field and Description |
|---|---|
protected double |
_doubleValue |
protected long |
_intValue |
protected static int[] |
SKIPPED_TOKENS |
| Constructor and Description |
|---|
JsonReader(Reader reader,
boolean strictDoubleParse,
boolean readMetadata) |
JsonReader(String source) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
begin(int character,
JsonType type) |
ObjectReader |
beginArray()
Starts reading an array.
|
ObjectReader |
beginObject()
Starts reading a object.
|
void |
close() |
int |
column() |
protected ValueType |
consumeLiteral()
Reads the next literal value into _booleanValue, _doubleValue or _intValue and returns the
type of the readed literal, possible values are : INTEGER, DOUBLE, BOOLEAN, NULL.
|
protected String |
consumeString(int token) |
protected ValueType |
consumeValue() |
JsonType |
enclosingType() |
protected void |
end(int character,
JsonType type) |
ObjectReader |
endArray()
Ends the array.
|
ObjectReader |
endObject()
Ends the object.
|
ValueType |
getValueType() |
boolean |
hasNext() |
protected boolean |
isEOF() |
String |
metadata(String name) |
String |
name() |
ValueType |
next()
If we are in a object it will read the next name/value pair and if we are in an array it will
read the next value (except if value is of complex type, in that case after the call to
next() you must use one of beginXXX methods).
|
ObjectReader |
nextObjectMetadata()
Will read nexts object metadata.
|
protected char |
readEscaped() |
protected void |
readMetadata() |
protected int |
readNextToken(boolean consume) |
int |
row() |
ObjectReader |
skipValue()
If the value is of complex type it will skip its content.
|
boolean |
valueAsBoolean() |
byte[] |
valueAsByteArray() |
double |
valueAsDouble() |
float |
valueAsFloat() |
int |
valueAsInt() |
long |
valueAsLong() |
short |
valueAsShort() |
String |
valueAsString() |
protected static final int[] SKIPPED_TOKENS
protected long _intValue
protected double _doubleValue
public JsonReader(String source)
public JsonReader(Reader reader, boolean strictDoubleParse, boolean readMetadata)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic ObjectReader beginArray()
ObjectReaderObjectReader.endArray() when the array
contains no more values.beginArray in interface ObjectReaderpublic ObjectReader beginObject()
ObjectReaderObjectReader.endObject() when the
objects contains no more properties.beginObject in interface ObjectReaderpublic ObjectReader nextObjectMetadata()
ObjectReaderObjectReader.metadata(String) method. For example if you call
ObjectReader.beginObject() you wont be able to do it anymore (however you still can retrieve the
metadata!).nextObjectMetadata in interface ObjectReaderpublic ObjectReader endArray()
ObjectReaderendArray in interface ObjectReaderpublic ObjectReader endObject()
ObjectReaderendObject in interface ObjectReaderpublic String name()
name in interface ObjectReaderObjectReader.next() before.public String valueAsString()
valueAsString in interface ObjectReaderpublic int valueAsInt()
valueAsInt in interface ObjectReaderObjectReader.valueAsString()public long valueAsLong()
valueAsLong in interface ObjectReaderObjectReader.valueAsString()public double valueAsDouble()
valueAsDouble in interface ObjectReaderObjectReader.valueAsString()public short valueAsShort()
valueAsShort in interface ObjectReaderObjectReader.valueAsString()public float valueAsFloat()
valueAsFloat in interface ObjectReaderObjectReader.valueAsString()public boolean valueAsBoolean()
valueAsBoolean in interface ObjectReaderObjectReader.valueAsString()public byte[] valueAsByteArray()
valueAsByteArray in interface ObjectReaderpublic String metadata(String name)
metadata in interface ObjectReadername - the name of the metadata to retrieve.public ValueType getValueType()
getValueType in interface ObjectReaderValueTypepublic ObjectReader skipValue()
ObjectReaderskipValue in interface ObjectReaderpublic boolean hasNext()
hasNext in interface ObjectReaderpublic ValueType next()
ObjectReadernext in interface ObjectReaderValueType for possible types.public JsonType enclosingType()
enclosingType in interface ObjectReaderprotected final ValueType consumeValue()
protected final void readMetadata()
protected final void begin(int character,
JsonType type)
protected final void end(int character,
JsonType type)
protected final String consumeString(int token)
protected final ValueType consumeLiteral()
readNextToken(boolean).protected final int readNextToken(boolean consume)
protected final char readEscaped()
protected final boolean isEOF()
public int column()
column in interface ObjectReaderpublic int row()
row in interface ObjectReaderCopyright © 2019. All rights reserved.