public final class JsonStream extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JsonStream.Status |
Constructor and Description |
---|
JsonStream(JsonArray jsonArray) |
JsonStream(JsonLiteral jsonLiteral) |
JsonStream(JsonObject json) |
JsonStream(JsonValue jsonValue) |
Modifier and Type | Method and Description |
---|---|
void |
begin()
Method peeks the Queue and set
getEntry() . |
void |
end()
Ends the stream.
|
JsonArray |
getJsonArray() |
JsonLiteral |
getJsonLiteral() |
JsonObject |
getJsonObject() |
JsonStream.Status |
getStatus() |
boolean |
hasNext() |
boolean |
isArrayStream() |
boolean |
isLiteralStream() |
boolean |
isObjectStream() |
String |
key() |
Iterator<String> |
keys() |
boolean |
next()
Method polls the Queue and set
getEntry() . |
JsonArray |
nextArray()
If there is no more element or next element type is not instance of JsonArray, method throws
JsonException |
boolean |
nextBool()
If there is no more element or next element type is not instance of Boolean, method throws
JsonException |
byte |
nextByte()
If next element is not type of byte, method throws
NumberFormatException . |
char |
nextChar()
If there is no more element or next element type is not instance of char, method throws
JsonException |
double |
nextDouble()
If next element is not type of double, method throws
NumberFormatException . |
float |
nextFloat()
If next element is not type of float, method throws
NumberFormatException . |
int |
nextInt()
If next element is not type of int, method throws
NumberFormatException . |
String |
nextKey() |
long |
nextLong()
If next element is not type of long, method throws
NumberFormatException . |
short |
nextShort()
If next element is not type of short, method throws
NumberFormatException . |
String |
nextString() |
JsonValue |
nextValue() |
JsonValue |
peek() |
JsonArray |
peekArray()
If peeked element type is not instance of JsonArray, method throws
JsonException |
byte |
peekByte() |
double |
peekDouble() |
float |
peekFloat() |
int |
peekInt() |
long |
peekLong() |
JsonObject |
peekObject() |
short |
peekShort() |
String |
peekString() |
int |
size() |
JsonValue |
value() |
Iterator<JsonValue> |
values() |
public JsonStream(JsonValue jsonValue)
jsonValue
- public JsonStream(JsonLiteral jsonLiteral)
jsonLiteral
- public JsonStream(JsonObject json)
json
- public JsonStream(JsonArray jsonArray)
jsonArray
- public boolean hasNext()
public String key()
public JsonValue value()
public void begin()
getEntry()
. After this method called,
key()
, value()
and other method connected to entry
can be
used.public JsonValue peek()
public boolean next()
public String nextString()
public String peekString()
public int nextInt()
NumberFormatException
.public int peekInt()
public double nextDouble()
NumberFormatException
.public double peekDouble()
public long nextLong()
NumberFormatException
.public long peekLong()
public float nextFloat()
NumberFormatException
.public float peekFloat()
public short nextShort()
NumberFormatException
.public short peekShort()
public byte nextByte()
NumberFormatException
.public byte peekByte()
public char nextChar()
JsonException
public boolean nextBool()
JsonException
boolean
.public JsonArray nextArray()
JsonException
JsonArray
.public JsonArray peekArray()
JsonException
JsonArray
.public JsonObject peekObject()
public String nextKey()
public JsonValue nextValue()
public void end()
key()
, value()
etc shouldn't be used. Also, when the method called
it overrides status to JsonStream.Status.End
.public int size()
public JsonStream.Status getStatus()
public JsonObject getJsonObject()
public JsonArray getJsonArray()
public JsonLiteral getJsonLiteral()
public boolean isObjectStream()
public boolean isArrayStream()
public boolean isLiteralStream()
Copyright © 2018 Terra Software Informatics LLC.. All rights reserved.