public class DefaultJacksonJson extends Object implements JacksonJson
JacksonJson implementation.Json.JsonException, Json.JsonReadException, Json.JsonWriteExceptionCONTEXT_KEY| Constructor and Description |
|---|
DefaultJacksonJson(com.fasterxml.jackson.databind.ObjectMapper mapper)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fromJson(JsonReader reader,
Class<T> type)
Deserializes the specified JSON source into an object of the specified type.
|
<P extends com.holonplatform.core.property.Property> |
fromJson(JsonReader reader,
Iterable<P> propertySet)
Deserializes the specified JSON data source into a
PropertyBox, using given propertySet as
PropertyBox property set. |
<T> List<T> |
fromJsonArray(JsonReader reader,
Class<T> type)
Deserializes the specified JSON array data source into a
List of objects of the specified type. |
<P extends com.holonplatform.core.property.Property> |
fromJsonArray(JsonReader reader,
Iterable<P> propertySet)
Deserializes the specified JSON array data source into a list of
PropertyBox, using given
propertySet as PropertyBox property set. |
JsonWriter |
toJson(Object value)
Serialize given
value to JSON. |
<T> JsonWriter |
toJsonArray(Class<T> type,
Collection<T> values)
Serialize given collection of values as a JSON array.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, createfromJson, fromJson, fromJson, fromJson, fromJsonArray, fromJsonArray, fromJsonArray, fromJsonArray, get, get, require, toJsonArray, toJsonArrayString, toJsonArrayString, toJsonStringpublic DefaultJacksonJson(com.fasterxml.jackson.databind.ObjectMapper mapper)
mapper - Jackson ObjectMapper (not null)public JsonWriter toJson(Object value)
Jsonvalue to JSON.toJson in interface Jsonvalue - Value to serializeJsonWriter from which to obtain the serialized JSON data.public <T> JsonWriter toJsonArray(Class<T> type, Collection<T> values)
JsontoJsonArray in interface JsonT - Values typetype - Value typevalues - Values collectionJsonWriter from which to obtain the serialized JSON data.public <T> T fromJson(JsonReader reader, Class<T> type)
Jsonpublic <T> List<T> fromJsonArray(JsonReader reader, Class<T> type)
JsonList of objects of the specified type.fromJsonArray in interface JsonT - desired object typereader - JSON data source (not null)type - the type of the desired objects (not null)public <P extends com.holonplatform.core.property.Property> com.holonplatform.core.property.PropertyBox fromJson(JsonReader reader, Iterable<P> propertySet)
JsonPropertyBox, using given propertySet as
PropertyBox property set.public <P extends com.holonplatform.core.property.Property> List<com.holonplatform.core.property.PropertyBox> fromJsonArray(JsonReader reader, Iterable<P> propertySet)
JsonPropertyBox, using given
propertySet as PropertyBox property set.fromJsonArray in interface JsonP - Actual property typereader - JSON data source (not null)propertySet - Property set to use to build the deserialized PropertyBoxs (not null)List of PropertyBoxCopyright © 2019 The Holon Platform. All rights reserved.