com.worldturner.medeia.parser.gson.gsonUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of medeia-validator-gson Show documentation
Show all versions of medeia-validator-gson Show documentation
Medeia streaming JSON-schema validator for the JVM platform,
Gson module.
The newest version!
package com.worldturner.medeia.parser.gson
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonToken
fun gsonParseAll(reader: JsonReader) {
loop@ do {
var token = reader.peek()!!
when (token) {
JsonToken.NUMBER -> reader.nextString()
JsonToken.STRING -> reader.nextString()
JsonToken.NAME -> reader.nextName()
JsonToken.BOOLEAN -> reader.nextBoolean()
JsonToken.NULL -> reader.nextNull()
JsonToken.BEGIN_ARRAY -> reader.beginArray()
JsonToken.END_ARRAY -> reader.endArray()
JsonToken.BEGIN_OBJECT -> reader.beginObject()
JsonToken.END_OBJECT -> reader.endObject()
JsonToken.END_DOCUMENT -> break@loop
}
} while (true)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy