JsonReader

com.github.plokhotnyuk.jsoniter_scala.core.JsonReader
See theJsonReader companion object
final class JsonReader

The reader to parse JSON input iteratively.

Value parameters

bbuf

the byte buffer with JSON input

buf

the internal buffer with JSON input

charBuf

the internal char buffer for parsed strings

config

the JSON reader configuration

head

the head position in the internal buffer

in

the input stream with JSON input

mark

the current mark position

tail

the tail position in the internal buffer

totalRead

the total number of read bytes

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def arrayEndError(): Nothing

Throws a JsonReaderException with the message expected ']'.

Throws a JsonReaderException with the message expected ']'.

Attributes

Throws
def arrayEndOrCommaError(): Nothing

Throws a JsonReaderException with the message expected ']' or ','.

Throws a JsonReaderException with the message expected ']' or ','.

Attributes

Throws
def arrayStartOrNullError(): Nothing

Throws a JsonReaderException with the message expected '[' or null.

Throws a JsonReaderException with the message expected '[' or null.

Attributes

Throws
def charBufToHashCode(len: Int): Int

Calculates a hash code for the internal char buffer of the given length.

Calculates a hash code for the internal char buffer of the given length.

Value parameters

len

the length of the char buffer to hash

Attributes

Returns

the hash code for the char buffer

def commaError(): Nothing

Throws a JsonReaderException with the message expected ','.

Throws a JsonReaderException with the message expected ','.

Attributes

Throws
def decodeError(msg: String): Nothing

Throws a JsonReaderException with the given message.

Throws a JsonReaderException with the given message.

Value parameters

msg

the exception message

Attributes

Throws
def discriminatorError(): Nothing

Throws a JsonReaderException indicating that an illegal discriminator field name was encountered.

Throws a JsonReaderException indicating that an illegal discriminator field name was encountered.

Attributes

def discriminatorValueError(discriminatorFieldName: String): Nothing

Throws a JsonReaderException indicating that an illegal value was encountered for the given discriminator field.

Throws a JsonReaderException indicating that an illegal value was encountered for the given discriminator field.

Value parameters

discriminatorFieldName

the name of the discriminator field

Attributes

Throws
def duplicatedKeyError(len: Int): Nothing

Throws a JsonReaderException indicating that a field with the given name is duplicated.

Throws a JsonReaderException indicating that a field with the given name is duplicated.

Value parameters

len

the length of the duplicated field name in the internal char buffer

Attributes

Throws
def enumValueError(value: String): Nothing

Throws a JsonReaderException indicating that an illegal enum value was encountered.

Throws a JsonReaderException indicating that an illegal enum value was encountered.

Value parameters

value

an illegal enum value

Attributes

Throws
def enumValueError(len: Int): Nothing

Throws a JsonReaderException indicating that an illegal enum value with the given length was encountered.

Throws a JsonReaderException indicating that an illegal enum value with the given length was encountered.

Value parameters

len

the length of the illegal enum value in the internal char buffer.

Attributes

Throws
def hasRemaining(): Boolean

Checks if there are more bytes available for reading in the input.

Checks if there are more bytes available for reading in the input.

Attributes

Returns

true if there are more bytes available, false otherwise

def isCharBufEqualsTo(len: Int, s: String): Boolean

Checks if the internal char buffer contains the given string.

Checks if the internal char buffer contains the given string.

Value parameters

len

the length of the char buffer to check

s

the string to match

Attributes

Returns

true if the char buffer contains s, false otherwise

def isCurrentToken(t: Byte): Boolean

Checks if the current token in the input matches the given one.

Checks if the current token in the input matches the given one.

Value parameters

t

the token to match

Attributes

Returns

true if the current token matches t, false otherwise.

Throws
java.lang.IllegalStateException

if no any token was parsed yet

def isNextToken(t: Byte): Boolean

Skips whitespaces, then checks if the next token in the input matches the given one.

Skips whitespaces, then checks if the next token in the input matches the given one.

Value parameters

t

the token to match

Attributes

Returns

true if the next token matches t, false otherwise

Throws
JsonReaderException

in cases of reaching the end of input

def nextByte(): Byte

Reads and returns the next byte from the input.

Reads and returns the next byte from the input.

Attributes

Returns

the next byte from the input

Throws
JsonReaderException

in cases of reaching the end of input

def nextToken(): Byte

Skips whitespaces, then reads and returns the next byte from the input.

Skips whitespaces, then reads and returns the next byte from the input.

Attributes

Returns

the next token from the input

Throws
JsonReaderException

in cases of reaching the end of input

def objectEndOrCommaError(): Nothing

Throws a JsonReaderException with the message expected '}' or ','.

Throws a JsonReaderException with the message expected '}' or ','.

Attributes

Throws
def objectStartOrNullError(): Nothing

Throws a JsonReaderException with the message expected '{' or null.

Throws a JsonReaderException with the message expected '{' or null.

Attributes

Throws
def readBase16AsBytes(default: Array[Byte]): Array[Byte]

Reads a JSON string value encoded with the base-16 format into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value encoded with the base-16 format into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default Array[Byte] value to return if the JSON value is null

Attributes

Returns

a Array[Byte] instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readBase64AsBytes(default: Array[Byte]): Array[Byte]

Reads a JSON string value encoded with the base-64 format into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value encoded with the base-64 format into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default Array[Byte] value to return if the JSON value is null

Attributes

Returns

a Array[Byte] instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readBase64UrlAsBytes(default: Array[Byte]): Array[Byte]

Reads a JSON string value encoded with the base-64 format for URLs into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value encoded with the base-64 format for URLs into a Array[Byte] instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default Array[Byte] value to return if the JSON value is null

Attributes

Returns

a Array[Byte] instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readBigDecimal(default: BigDecimal): BigDecimal

Reads a JSON number value into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigDecimal value to return if the JSON value is null

Attributes

Returns

a BigDecimal instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding of default limits or when both the JSON value and the provided default value are null

def readBigDecimal(default: BigDecimal, mc: MathContext, scaleLimit: Int, digitsLimit: Int): BigDecimal

Reads a JSON number value into a BigDecimal instance with the provided limit of allowed digits for mantissa, the provided limit for scale, and the provided instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigDecimal instance with the provided limit of allowed digits for mantissa, the provided limit for scale, and the provided instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigDecimal value to return if the JSON value is null

digitsLimit

the maximum number of decimal digits allowed

mc

the precision to use

scaleLimit

the maximum number of decimal places (scale) allowed

Attributes

Returns

a BigDecimal instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding of provided limits or when both the JSON value and the provided default value are null

def readBigInt(default: BigInt): BigInt

Reads a JSON number value into a BigInt instance with the default limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigInt instance with the default limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigInt value to return if the JSON value is null

Attributes

Returns

a BigInt instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding of the default limit or when both the JSON value and the provided default value are null

def readBigInt(default: BigInt, digitsLimit: Int): BigInt

Reads a JSON number value into a BigInt instance with the provided limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigInt instance with the provided limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigInt value to return if the JSON value is null

digitsLimit

the maximum number of decimal digits allowed in the parsed BigInt value

Attributes

Returns

a BigInt instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding of the default limit or when both the JSON value and the provided default value are null

def readBoolean(): Boolean

Reads a JSON boolean value into a Boolean value.

Reads a JSON boolean value into a Boolean value.

Attributes

Returns

a Boolean value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or unexpected JSON value

def readByte(): Byte

Reads a JSON number value into a Byte value.

Reads a JSON number value into a Byte value.

Attributes

Returns

a Byte value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or dection of leading zero or illegal format of JSON value or exceeding capacity of Byte

def readChar(): Char

Reads a JSON string value into a Char value.

Reads a JSON string value into a Char value.

Attributes

Returns

a Char value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON value or exceeding capacity of Char or when parsed char is a part of a surrogate pair

def readDouble(): Double

Reads a JSON number value into a Double value.

Reads a JSON number value into a Double value.

Attributes

Returns

a Double value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value

def readDuration(default: Duration): Duration

Reads a JSON string value into a java.time.Duration instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.Duration instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.Duration value to return if the JSON value is null

Attributes

Returns

a java.time.Duration instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readFloat(): Float

Reads a JSON number value into a Float value.

Reads a JSON number value into a Float value.

Attributes

Returns

a Float value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value

def readInstant(default: Instant): Instant

Reads a JSON string value into a java.time.Instant instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.Instant instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.Instant value to return if the JSON value is null

Attributes

Returns

a java.time.Instant instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readInt(): Int

Reads a JSON value into a Int value.

Reads a JSON value into a Int value.

Attributes

Returns

a Int value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding capacity of Int

def readKeyAsBigDecimal(): BigDecimal

Reads a JSON key into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision.

Reads a JSON key into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision.

Attributes

Returns

a BigDecimal instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key or exceeding of default limits

def readKeyAsBigDecimal(mc: MathContext, scaleLimit: Int, digitsLimit: Int): BigDecimal

Reads a JSON key into a Scala BigDecimal instance with the given precision, scale limit, and digits limit.

Reads a JSON key into a Scala BigDecimal instance with the given precision, scale limit, and digits limit.

Value parameters

digitsLimit

the maximum number of decimal digits allowed

mc

the precision to use

scaleLimit

the maximum number of decimal places (scale) allowed

Attributes

Returns

a BigDecimal instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key or exceeding of provided limits

def readKeyAsBigInt(): BigInt

Reads a JSON key into a BigInt instance with the default limit of allowed digits.

Reads a JSON key into a BigInt instance with the default limit of allowed digits.

Attributes

Returns

a BigInt instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key or exceeding of the default limit

def readKeyAsBigInt(digitsLimit: Int): BigInt

Reads a JSON key into a BigInt instance with the given limit of allowed digits.

Reads a JSON key into a BigInt instance with the given limit of allowed digits.

Value parameters

digitsLimit

the maximum number of decimal digits allowed in the parsed BigInt value

Attributes

Returns

a BigInt instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key or exceeding of the provided limit

def readKeyAsBoolean(): Boolean

Reads a JSON key into a Boolean value.

Reads a JSON key into a Boolean value.

Attributes

Returns

a Boolean value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsByte(): Byte

Reads a JSON key into a Byte value.

Reads a JSON key into a Byte value.

Attributes

Returns

a Byte value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsChar(): Char

Reads a JSON key into a Char value.

Reads a JSON key into a Char value.

Attributes

Returns

a Char value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key or exceeding capacity of Char or when parsed char is a part of a surrogate pair

def readKeyAsCharBuf(): Int

Reads a JSON key into the internal char buffer and returns the length of the key.

Reads a JSON key into the internal char buffer and returns the length of the key.

Attributes

Returns

the length of the key in the internal char buffer

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON key

def readKeyAsDouble(): Double

Reads a JSON key into a Double value.

Reads a JSON key into a Double value.

Attributes

Returns

a Double value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsDuration(): Duration

Reads a JSON key into a java.time.Duration instance.

Reads a JSON key into a java.time.Duration instance.

Attributes

Returns

a java.time.Duration instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsFloat(): Float

Reads a JSON key into a Float value.

Reads a JSON key into a Float value.

Attributes

Returns

a Float value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsInstant(): Instant

Reads a JSON key into a java.time.Instant instance.

Reads a JSON key into a java.time.Instant instance.

Attributes

Returns

a java.time.Instant instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsInt(): Int

Reads a JSON key into a Int value.

Reads a JSON key into a Int value.

Attributes

Returns

a Int value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsLocalDate(): LocalDate

Reads a JSON key into a java.time.LocalDate instance.

Reads a JSON key into a java.time.LocalDate instance.

Attributes

Returns

a java.time.LocalDate instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsLocalDateTime(): LocalDateTime

Reads a JSON key into a java.time.LocalDateTime instance.

Reads a JSON key into a java.time.LocalDateTime instance.

Attributes

Returns

a java.time.LocalDateTime instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsLocalTime(): LocalTime

Reads a JSON key into a java.time.LocalTime instance.

Reads a JSON key into a java.time.LocalTime instance.

Attributes

Returns

a java.time.LocalTime instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsLong(): Long

Reads a JSON key into a Long value.

Reads a JSON key into a Long value.

Attributes

Returns

a Long value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsMonthDay(): MonthDay

Reads a JSON key into a java.time.MonthDay instance.

Reads a JSON key into a java.time.MonthDay instance.

Attributes

Returns

a java.time.MonthDay instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsOffsetDateTime(): OffsetDateTime

Reads a JSON key into a java.time.OffsetDateTime instance.

Reads a JSON key into a java.time.OffsetDateTime instance.

Attributes

Returns

a java.time.OffsetDateTime instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsOffsetTime(): OffsetTime

Reads a JSON key into a java.time.OffsetTime instance.

Reads a JSON key into a java.time.OffsetTime instance.

Attributes

Returns

a java.time.OffsetTime instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsPeriod(): Period

Reads a JSON key into a java.time.Period instance.

Reads a JSON key into a java.time.Period instance.

Attributes

Returns

a java.time.Period instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsShort(): Short

Reads a JSON key into a Short value.

Reads a JSON key into a Short value.

Attributes

Returns

a Short value of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsString(): String

Reads a JSON key into the internal char buffer and returns a String instance.

Reads a JSON key into the internal char buffer and returns a String instance.

Attributes

Returns

a String instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON key

def readKeyAsUUID(): UUID

Reads a JSON key into a java.util.UUID instance.

Reads a JSON key into a java.util.UUID instance.

Attributes

Returns

a java.util.UUID instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsYear(): Year

Reads a JSON key into a java.time.Year instance.

Reads a JSON key into a java.time.Year instance.

Attributes

Returns

a java.time.Year instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsYearMonth(): YearMonth

Reads a JSON key into a java.time.YearMonth instance.

Reads a JSON key into a java.time.YearMonth instance.

Attributes

Returns

a java.time.YearMonth instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsZoneId(): ZoneId

Reads a JSON key into a java.time.ZoneId instance.

Reads a JSON key into a java.time.ZoneId instance.

Attributes

Returns

a java.time.ZoneId instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsZoneOffset(): ZoneOffset

Reads a JSON key into a java.time.ZoneOffset instance.

Reads a JSON key into a java.time.ZoneOffset instance.

Attributes

Returns

a java.time.ZoneOffset instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readKeyAsZonedDateTime(): ZonedDateTime

Reads a JSON key into a java.time.ZonedDateTime instance.

Reads a JSON key into a java.time.ZonedDateTime instance.

Attributes

Returns

a java.time.ZonedDateTime instance of the parsed JSON key

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON key

def readLocalDate(default: LocalDate): LocalDate

Reads a JSON string value into a java.time.LocalDate instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.LocalDate instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.LocalDate value to return if the JSON value is null

Attributes

Returns

a java.time.LocalDate instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readLocalDateTime(default: LocalDateTime): LocalDateTime

Reads a JSON string value into a java.time.LocalDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.LocalDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.LocalDateTime value to return if the JSON value is null

Attributes

Returns

a java.time.LocalDateTime instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readLocalTime(default: LocalTime): LocalTime

Reads a JSON string value into a java.time.LocalTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.LocalTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.LocalTime value to return if the JSON value is null

Attributes

Returns

a java.time.LocalTime instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readLong(): Long

Reads a JSON number value into a Long value.

Reads a JSON number value into a Long value.

Attributes

Returns

a Long value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding capacity of Long

def readMonthDay(default: MonthDay): MonthDay

Reads a JSON string value into a java.time.MonthDay instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.MonthDay instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.MonthDay value to return if the JSON value is null

Attributes

Returns

a java.time.MonthDay instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readNullOrError[A](default: A, msg: String): A

Finishes reading the null JSON value and returns the provided default value or throws JsonReaderException. Before calling it the n token should be parsed already.

Finishes reading the null JSON value and returns the provided default value or throws JsonReaderException. Before calling it the n token should be parsed already.

Type parameters

A

the type of the default value

Value parameters

default

the default value to return

msg

the exception message

Attributes

Returns

the default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when the provided default value is null

def readNullOrTokenError[A](default: A, t: Byte): A

Finishes reading the null JSON value and returns the provided default value or throws JsonReaderException with a message of expecting null or the provided token. Before calling it the n token should be parsed already.

Finishes reading the null JSON value and returns the provided default value or throws JsonReaderException with a message of expecting null or the provided token. Before calling it the n token should be parsed already.

Type parameters

A

the type of the default value

Value parameters

default

the default value to return

t

the token for an error message

Attributes

Returns

the default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when the provided default value is null

def readOffsetDateTime(default: OffsetDateTime): OffsetDateTime

Reads a JSON string value into a java.time.OffsetDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.OffsetDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.OffsetDateTime value to return if the JSON value is null

Attributes

Returns

a java.time.OffsetDateTime instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readOffsetTime(default: OffsetTime): OffsetTime

Reads a JSON string value into a java.time.OffsetTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.OffsetTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.OffsetTime value to return if the JSON value is null.

Attributes

Returns

a java.time.OffsetTime instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readPeriod(default: Period): Period

Reads a JSON string value into a java.time.Period instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.Period instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.Period value to return if the JSON value is null

Attributes

Returns

a java.time.Period instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readRawValAsBytes(): Array[Byte]

Reads a raw JSON value into a Array[Byte] instance without parsing.

Reads a raw JSON value into a Array[Byte] instance without parsing.

Attributes

Returns

a Array[Byte] instance containing the raw bytes of the JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or invalid type of JSON value

def readShort(): Short

Reads a JSON number value into a Short value.

Reads a JSON number value into a Short value.

Attributes

Returns

a Short value of the parsed JSON value

Throws
JsonReaderException

in cases of reaching the end of input or detection of leading zero or illegal format of JSON value or exceeding capacity of Short

def readString(default: String): String

Reads a JSON string value into a String instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a String instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default String value to return if the JSON value is null.

Attributes

Returns

a String instance of the parsed JSON value or the default value if the JSON value is null.

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON value or when both the JSON value and the provided default value are null

def readStringAsBigDecimal(default: BigDecimal): BigDecimal

Reads a JSON number value into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigDecimal instance with the default limit of allowed digits for mantissa, the default limit for scale, and the default instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigDecimal value to return if the JSON value is null

Attributes

Returns

a BigDecimal instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding of default limits or when both the JSON value and the provided default value are null

def readStringAsBigDecimal(default: BigDecimal, mc: MathContext, scaleLimit: Int, digitsLimit: Int): BigDecimal

Reads a JSON number value into a BigDecimal instance with the provided limit of allowed digits for mantissa, the provided limit for scale, and the provided instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON number value into a BigDecimal instance with the provided limit of allowed digits for mantissa, the provided limit for scale, and the provided instance of java.math.MathContext for precision. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigDecimal value to return if the JSON value is null

digitsLimit

the maximum number of decimal digits allowed

mc

the precision to use

scaleLimit

the maximum number of decimal places (scale) allowed

Attributes

Returns

a BigDecimal instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding of provided limits or when both the JSON value and the provided default value are null

def readStringAsBigInt(default: BigInt): BigInt

Reads a JSON string value into a BigInt instance with the default limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a BigInt instance with the default limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigInt value to return if the JSON value is null

Attributes

Returns

a BigInt instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding of the default limit or when both the JSON value and the provided default value are null

def readStringAsBigInt(default: BigInt, digitsLimit: Int): BigInt

Reads a JSON string value into a BigInt instance with the provided limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a BigInt instance with the provided limit of allowed digits. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default BigInt value to return if the JSON value is null

digitsLimit

the maximum number of decimal digits allowed in the parsed BigInt value

Attributes

Returns

a BigInt instance of the parsed JSON value or the provided default value

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding of the default limit or when both the JSON value and the provided default value are null

def readStringAsBoolean(): Boolean

Reads a JSON string value into a Boolean value.

Reads a JSON string value into a Boolean value.

Attributes

Returns

a Boolean value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value

def readStringAsByte(): Byte

Reads a JSON string value into a Byte value.

Reads a JSON string value into a Byte value.

Attributes

Returns

a Byte value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding capacity of Byte

def readStringAsCharBuf(): Int

Reads a JSON string value into the internal char buffer and returns the length of the string.

Reads a JSON string value into the internal char buffer and returns the length of the string.

Attributes

Returns

a length of the string in the internal char buffer

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON value

def readStringAsDouble(): Double

Reads a JSON string value into a Double value.

Reads a JSON string value into a Double value.

Attributes

Returns

a Double value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value

def readStringAsFloat(): Float

Reads a JSON string value into a Float value.

Reads a JSON string value into a Float value.

Attributes

Returns

a Float value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value

def readStringAsInt(): Int

Reads a JSON string value into a Int value.

Reads a JSON string value into a Int value.

Attributes

Returns

a Int value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding capacity of Int

def readStringAsLong(): Long

Reads a JSON string value into a Long value.

Reads a JSON string value into a Long value.

Attributes

Returns

a Long value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding capacity of Long

def readStringAsShort(): Short

Reads a JSON string value into a Short value.

Reads a JSON string value into a Short value.

Attributes

Returns

a Short value of the parsed JSON value.

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or exceeding capacity of Short

def readUUID(default: UUID): UUID

Reads a JSON string value into a java.util.UUID instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.util.UUID instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.util.UUID value to return if the JSON value is null

Attributes

Returns

a java.util.UUID instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readYear(default: Year): Year

Reads a JSON string value into a java.time.Year instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.Year instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.Year value to return if the JSON value is null

Attributes

Returns

a java.time.Year instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readYearMonth(default: YearMonth): YearMonth

Reads a JSON string value into a java.time.YearMonth instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.YearMonth instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.YearMonth value to return if the JSON value is null

Attributes

Returns

a java.time.YearMonth instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readZoneId(default: ZoneId): ZoneId

Reads a JSON string value into a java.time.ZoneId instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.ZoneId instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.ZoneId value to return if the JSON value is null

Attributes

Returns

a java.time.ZoneId instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readZoneOffset(default: ZoneOffset): ZoneOffset

Reads a JSON string value into a java.time.ZoneOffset instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.ZoneOffset instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.ZoneOffset value to return if the JSON value is null

Attributes

Returns

a java.time.ZoneOffset instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def readZonedDateTime(default: ZonedDateTime): ZonedDateTime

Reads a JSON string value into a java.time.ZonedDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Reads a JSON string value into a java.time.ZonedDateTime instance. In case of null JSON value returns the provided default value or throws a JsonReaderException if the provided default value is null.

Value parameters

default

the default java.time.ZonedDateTime value to return if the JSON value is null

Attributes

Returns

a java.time.ZonedDateTime instance of the parsed JSON value or the default value if the JSON value is null

Throws
JsonReaderException

in cases of reaching the end of input or illegal format of JSON value or when both the JSON value and the provided default value are null

def requiredFieldError(reqField: String): Nothing

Throws a JsonReaderException indicating that a required field with the given name is missing.

Throws a JsonReaderException indicating that a required field with the given name is missing.

Value parameters

reqField

the name of the missing required field

Attributes

Throws
def rollbackToMark(): Unit

Rolls back the read head position to the previously set mark.

Rolls back the read head position to the previously set mark.

Attributes

Throws
java.lang.IllegalStateException

in cases of reaching the end of input or invalid encoding of JSON key

def rollbackToken(): Unit

Rolls back the current reading position by one.

Rolls back the current reading position by one.

Attributes

Throws
java.lang.IllegalStateException

if no any token was parsed yet

def setMark(): Unit

Sets the current read head position as a mark.

Sets the current read head position as a mark.

Attributes

def skip(): Unit

Skips the next JSON value.

Skips the next JSON value.

Attributes

Throws
JsonReaderException

in cases of reaching the end of input

def skipToKey(key: String): Boolean

Skips tokens with in the current JSON object until a key with the given name is encountered.

Skips tokens with in the current JSON object until a key with the given name is encountered.

Value parameters

key

the name of the JSON key to skip to

Attributes

Returns

true if the key was found, false otherwise

Throws
JsonReaderException

in cases of reaching the end of input or invalid encoding of JSON key

def unexpectedKeyError(len: Int): Nothing

Throws a JsonReaderException indicating that an unexpected field with the given name was encountered.

Throws a JsonReaderException indicating that an unexpected field with the given name was encountered.

Value parameters

len

the length of the unexpected field name in the internal char buffer

Attributes

Throws