JsonReader

zio.blocks.schema.json.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

markNum

the number of mark positions in the stack

marks

the stack of mark positions

maxTop

a maximum offset of the stack top

stack

a pre-allocated stack of registers

tail

the tail position in the internal buffer

top

an offset of the stack top

totalRead

the total number of read bytes

Attributes

Companion
object
Source
JsonReader.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def arrayEndOrCommaError(): Nothing

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

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

Attributes

Throws
Source
JsonReader.scala
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

Source
JsonReader.scala
def discriminatorError(): Nothing

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

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

Attributes

Source
JsonReader.scala
def discriminatorValueError(discriminatorFieldName: String): Nothing

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

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

Value parameters

discriminatorFieldName

the name of the discriminator field

Attributes

Throws
Source
JsonReader.scala
def duplicatedKeyError(len: Int): Nothing

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

Throws a JsonCodecError 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
Source
JsonReader.scala
def enumValueError(len: Int): Nothing

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

Throws a JsonCodecError 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
Source
JsonReader.scala
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

Source
JsonReader.scala
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

Source
JsonReader.scala
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

Source
JsonReader.scala
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
JsonCodecError

in cases of reaching the end of input

Source
JsonReader.scala
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
JsonCodecError

in cases of reaching the end of input

Source
JsonReader.scala
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
JsonCodecError

in cases of reaching the end of input

Source
JsonReader.scala
def nextTokenOrError(t: Byte): Unit

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

Throws
JsonCodecError

in cases of reaching the end of input or unexpected token is detected

Source
JsonReader.scala
def objectEndOrCommaError(): Nothing

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

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

Attributes

Throws
Source
JsonReader.scala
def pop(offset: RegisterOffset): Unit

Attributes

Source
JsonReader.scala

Attributes

Source
JsonReader.scala
def readBigDecimal(): 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 unexpected JSON value throws a JsonCodecError.

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 unexpected JSON value throws a JsonCodecError.

Attributes

Returns

a BigDecimal instance of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readBigDecimal(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 unexpected JSON value throws a JsonCodecError.

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 unexpected JSON value throws a JsonCodecError.

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 value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readBigInt(): BigInt

Reads a JSON number value into a BigInt instance with the default limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON number value into a BigInt instance with the default limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

a BigInt instance of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readBigInt(digitsLimit: Int): BigInt

Reads a JSON number value into a BigInt instance with the provided limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON number value into a BigInt instance with the provided limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Value parameters

digitsLimit

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

Attributes

Returns

a BigInt instance of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.Duration instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.Duration instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.Instant instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.Instant instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
def readInt(): Int

Reads a JSON value into an Int value.

Reads a JSON value into an Int value.

Attributes

Returns

an Int value of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala
def readKeyAsInt(): Int

Reads a JSON key into an Int value.

Reads a JSON key into an Int value.

Attributes

Returns

an Int value of the parsed JSON key

Throws
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

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
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.LocalDate instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.LocalDate instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.LocalDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.LocalDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.LocalTime instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.LocalTime instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.MonthDay instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.MonthDay instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
def readNullOrError[A](default: A, msg: String): A

Reads null JSON value and returns the provided default value or throws JsonCodecError.

Reads null JSON value and returns the provided default value or throws JsonCodecError.

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
JsonCodecError

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

Source
JsonReader.scala
def readNullOrTokenError[A](default: A, t: Byte): A

Reads null JSON value and returns the provided default value or throws JsonCodecError with a message of expecting null or the provided token.

Reads null JSON value and returns the provided default value or throws JsonCodecError with a message of expecting null or the provided token.

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
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.OffsetDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.OffsetDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.OffsetTime instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.OffsetTime instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.Period instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.Period instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
def readRawValAsBytes(): Array[Byte]

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

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

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
def readString(): String

Reads a JSON string value into a String instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a String instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

a String instance of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readStringAsBigDecimal(): 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 unexpected JSON value throws a JsonCodecError.

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 unexpected JSON value throws a JsonCodecError.

Attributes

Returns

a BigDecimal instance of the parsed JSON value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readStringAsBigDecimal(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 unexpected JSON value throws a JsonCodecError.

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 unexpected JSON value throws a JsonCodecError.

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 value

Throws
JsonCodecError

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

Source
JsonReader.scala
def readStringAsBigInt(): BigInt

Reads a JSON string value into a BigInt instance with the default limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a BigInt instance with the default limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

a BigInt instance of the parsed JSON value

Throws
JsonCodecError

in cases of reaching the end of input or illegal format of JSON value or exceeding of the default limit of allowed digits

Source
JsonReader.scala
def readStringAsBigInt(digitsLimit: Int): BigInt

Reads a JSON string value into a BigInt instance with the provided limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a BigInt instance with the provided limit of allowed digits. In case of unexpected JSON value throws a JsonCodecError.

Value parameters

digitsLimit

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

Attributes

Returns

a BigInt instance of the parsed JSON value

Throws
JsonCodecError

in cases of reaching the end of input or illegal format of JSON value or exceeding of the default limit of allowed digits

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
def readStringAsInt(): Int

Reads a JSON string value into an Int value.

Reads a JSON string value into an Int value.

Attributes

Returns

an Int value of the parsed JSON value.

Throws
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
def readUUID(): UUID

Reads a JSON string value into a java.util.UUID instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.util.UUID instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala
def readYear(): Year

Reads a JSON string value into a java.time.Year instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.Year instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.YearMonth instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.YearMonth instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.ZoneId instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.ZoneId instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.ZoneOffset instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.ZoneOffset instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Reads a JSON string value into a java.time.ZonedDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Reads a JSON string value into a java.time.ZonedDateTime instance. In case of unexpected JSON value throws a JsonCodecError.

Attributes

Returns

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

Throws
JsonCodecError

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

Source
JsonReader.scala

Attributes

Source
JsonReader.scala
def requiredFieldError(reqField: String): Nothing

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

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

Value parameters

reqField

the name of the missing required field

Attributes

Throws
Source
JsonReader.scala
def resetMark(): Unit

Reset mark without changing of the read head position.

Reset mark without changing of the read head position.

Attributes

Throws
java.lang.IllegalStateException

in case of calling without a preceding call of 'setMark()'

Source
JsonReader.scala
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 case of calling without a preceding call of 'setMark()'

Source
JsonReader.scala
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

Source
JsonReader.scala
def setMark(): Unit

Sets the current read head position as a mark. Should be followed by resetMark() or rollbackToMark() calls. Pair of setMark() and resetMark() or setMark() and rollbackToMark() calls can be nested.

Sets the current read head position as a mark. Should be followed by resetMark() or rollbackToMark() calls. Pair of setMark() and resetMark() or setMark() and rollbackToMark() calls can be nested.

Attributes

Source
JsonReader.scala
def skip(): Unit

Skips the next JSON value.

Skips the next JSON value.

Attributes

Throws
JsonCodecError

in cases of reaching the end of input

Source
JsonReader.scala
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
JsonCodecError

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

Source
JsonReader.scala
def unexpectedKeyError(len: Int): Nothing

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

Throws a JsonCodecError 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
Source
JsonReader.scala