public class JSONWrappedObject extends java.lang.Object implements JsonSerializable
JSONPObject
JsonSerializable.Base
Constructor and Description |
---|
JSONWrappedObject(java.lang.String prefix,
java.lang.String suffix,
java.lang.Object value) |
JSONWrappedObject(java.lang.String prefix,
java.lang.String suffix,
java.lang.Object value,
JavaType asType)
Constructor that should be used when specific serialization type to use
is important, and needs to be passed instead of just using runtime
(type-erased) type of the value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPrefix() |
JavaType |
getSerializationType() |
java.lang.String |
getSuffix() |
java.lang.Object |
getValue() |
void |
serialize(JsonGenerator jgen,
SerializerProvider provider)
Serialization method called when no additional type information is
to be included in serialization.
|
void |
serializeWithType(JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
Serialization method called when additional type information is
expected to be included in serialization, for deserialization to use.
|
public JSONWrappedObject(java.lang.String prefix, java.lang.String suffix, java.lang.Object value)
public JSONWrappedObject(java.lang.String prefix, java.lang.String suffix, java.lang.Object value, JavaType asType)
public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws java.io.IOException, JsonProcessingException
JsonSerializable
Usually implementation consists of a call to TypeSerializer.writeTypePrefix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
followed by serialization of contents,
followed by a call to TypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
).
Details of the type id argument to pass depend on shape of JSON Object used
(Array, Object or scalar like String/Number/Boolean).
Note that some types (most notably, "natural" types: String, Integer, Double and Boolean) never include type information.
serializeWithType
in interface JsonSerializable
java.io.IOException
JsonProcessingException
public void serialize(JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonProcessingException
JsonSerializable
serialize
in interface JsonSerializable
java.io.IOException
JsonProcessingException
public java.lang.String getPrefix()
public java.lang.String getSuffix()
public java.lang.Object getValue()
public JavaType getSerializationType()
Copyright © 2010 - 2020 Adobe. All Rights Reserved