public class DefaultJsonParser extends Object implements JsonParser
JsonParser
that should fit most use cases. Utilizes the Jackson library for maintaining
the JSON tree model and provides the ability to create new instances of the JsonValue
, JsonArray
and
JsonObject
.Constructor and Description |
---|
DefaultJsonParser() |
Modifier and Type | Method and Description |
---|---|
JsonArray |
createJsonArray()
Create a new empty
JsonArray . |
JsonObject |
createJsonObject()
Create a new empty
JsonObject . |
JsonValue |
createJsonValue(ByteBuffer bytes)
Create a new
JsonValue from the provided ByteBuffer . |
JsonValue |
createJsonValue(String value)
Create a new
JsonValue from the provided value. |
JsonValue |
fromObject(Object object)
Create a new
JsonValue from the provided object. |
JsonValue |
loadJsonValue(ByteBuffer bytes)
Loads the provided
ByteBuffer in a new JsonValue . |
public JsonValue loadJsonValue(ByteBuffer bytes)
JsonParser
ByteBuffer
in a new JsonValue
. Does not start the actual processing of the
ByteBuffer
until a method of the JsonValue
is called.loadJsonValue
in interface JsonParser
bytes
- the ByteBuffer
to create the JsonValue
fromJsonValue
public JsonValue createJsonValue(ByteBuffer bytes)
JsonParser
JsonValue
from the provided ByteBuffer
.createJsonValue
in interface JsonParser
bytes
- the ByteBuffer
to create the JsonValue
fromJsonValue
public JsonValue createJsonValue(String value)
JsonParser
JsonValue
from the provided value.createJsonValue
in interface JsonParser
value
- the value to create the JsonValue
fromJsonValue
public JsonObject createJsonObject()
JsonParser
JsonObject
.createJsonObject
in interface JsonParser
JsonObject
public JsonArray createJsonArray()
JsonParser
JsonArray
.createJsonArray
in interface JsonParser
JsonArray
public JsonValue fromObject(Object object)
JsonParser
JsonValue
from the provided object.fromObject
in interface JsonParser
object
- the object to create the JsonValue
fromJsonValue
Copyright © 2024 lettuce.io. All rights reserved.