java.lang.Object
tools.jackson.databind.util.JSONPObject
- All Implemented Interfaces:
JacksonSerializable
Container class that can be used to wrap any Object instances (including
nulls), and will serialize embedded in
JSONP wrapping.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.jackson.databind.JacksonSerializable
JacksonSerializable.Base -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJSONPObject(String function, Object value) JSONPObject(String function, Object value, JavaType asType) -
Method Summary
Modifier and TypeMethodDescriptiongetValue()voidserialize(tools.jackson.core.JsonGenerator gen, SerializationContext ctxt) Serialization method called when no additional type information is to be included in serialization.voidserializeWithType(tools.jackson.core.JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.
-
Field Details
-
_function
JSONP function name to use for serialization -
_value
Value to be serialized as JSONP padded; can be null. -
_serializationType
Optional static type to use for serialization; if null, runtime type is used. Can be used to specify declared type which defines serializer to use, as well as aspects of extra type information to include (if any).
-
-
Constructor Details
-
JSONPObject
-
JSONPObject
-
-
Method Details
-
serializeWithType
public void serializeWithType(tools.jackson.core.JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws tools.jackson.core.JacksonException Description copied from interface:JacksonSerializableSerialization method called when additional type information is expected to be included in serialization, for deserialization to use.Usually implementation consists of a call to
TypeSerializer.writeTypePrefix(tools.jackson.core.JsonGenerator, tools.jackson.databind.SerializationContext, tools.jackson.core.type.WritableTypeId)followed by serialization of contents, followed by a call toTypeSerializer.writeTypeSuffix(tools.jackson.core.JsonGenerator, tools.jackson.databind.SerializationContext, tools.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.
- Specified by:
serializeWithTypein interfaceJacksonSerializable- Throws:
tools.jackson.core.JacksonException
-
serialize
public void serialize(tools.jackson.core.JsonGenerator gen, SerializationContext ctxt) throws tools.jackson.core.JacksonException Description copied from interface:JacksonSerializableSerialization method called when no additional type information is to be included in serialization.- Specified by:
serializein interfaceJacksonSerializable- Throws:
tools.jackson.core.JacksonException
-
getFunction
-
getValue
-
getSerializationType
-