Package io.avaje.jsonb
Interface JsonReader
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface JsonReader extends Closeable
Reads json content as a stream of JSON tokens and content.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classJsonReader.TokenA structure, name, or value type in a JSON-encoded string.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeginArray()Read array begin.voidbeginObject()Read begin object.voidclose()Close the resources of the reader.JsonReader.TokencurrentToken()Return the current Token.voidendArray()Read array end.voidendObject()Read end object.booleanhasNextElement()Return true if there is a next element in an ARRAY.booleanhasNextField()Return true if there is a next field to be read in an OBJECT.booleanisNullValue()Return true if the value to be read is a null.Stringlocation()Return the current location.voidnames(PropertyNames names)Set the current property names.StringnextField()Return the next field.BigIntegerreadBigInteger()Read and return the next value as a BigInteger.booleanreadBoolean()Read and return the next value as a boolean.BigDecimalreadDecimal()Read and return the next value as a BigDecimal.doublereadDouble()Read and return the next value as a double.intreadInt()Read and return the next value as an int.longreadLong()Read and return the next value as a long.StringreadString()Read and return the next value as String.voidskipValue()Skip the next value.voidunmappedField(String fieldName)Reading json with an unmapped field, throw an Exception if failOnUnmapped is true.
-
-
-
Method Detail
-
names
void names(PropertyNames names)
Set the current property names.Can be used by the reader to optimise the reading of known names.
-
beginArray
void beginArray()
Read array begin.
-
endArray
void endArray()
Read array end.
-
hasNextElement
boolean hasNextElement()
Return true if there is a next element in an ARRAY.
-
beginObject
void beginObject()
Read begin object.
-
endObject
void endObject()
Read end object.
-
hasNextField
boolean hasNextField()
Return true if there is a next field to be read in an OBJECT.
-
isNullValue
boolean isNullValue()
Return true if the value to be read is a null.
-
readBoolean
boolean readBoolean()
Read and return the next value as a boolean.
-
readInt
int readInt()
Read and return the next value as an int.
-
readLong
long readLong()
Read and return the next value as a long.
-
readDouble
double readDouble()
Read and return the next value as a double.
-
readDecimal
BigDecimal readDecimal()
Read and return the next value as a BigDecimal.
-
readBigInteger
BigInteger readBigInteger()
Read and return the next value as a BigInteger.
-
readString
String readString()
Read and return the next value as String.
-
location
String location()
Return the current location. This is typically used when reporting errors.
-
currentToken
JsonReader.Token currentToken()
Return the current Token.
-
close
void close()
Close the resources of the reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
skipValue
void skipValue()
Skip the next value.
-
unmappedField
void unmappedField(String fieldName)
Reading json with an unmapped field, throw an Exception if failOnUnmapped is true.
-
-