Class JSONPObject
- java.lang.Object
-
- com.fasterxml.jackson.databind.util.JSONPObject
-
- All Implemented Interfaces:
JsonSerializable
public class JSONPObject extends java.lang.Object implements JsonSerializable
Container class that can be used to wrap any Object instances (including nulls), and will serialize embedded in JSONP wrapping.- See Also:
JSONWrappedObject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable
JsonSerializable.Base
-
-
Constructor Summary
Constructors Constructor Description JSONPObject(java.lang.String function, java.lang.Object value)
JSONPObject(java.lang.String function, java.lang.Object value, JavaType asType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFunction()
JavaType
getSerializationType()
java.lang.Object
getValue()
void
serialize(JsonGenerator gen, SerializerProvider provider)
Serialization method called when no additional type information is to be included in serialization.void
serializeWithType(JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer)
Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.
-
-
-
Constructor Detail
-
JSONPObject
public JSONPObject(java.lang.String function, java.lang.Object value)
-
JSONPObject
public JSONPObject(java.lang.String function, java.lang.Object value, JavaType asType)
-
-
Method Detail
-
serializeWithType
public void serializeWithType(JsonGenerator gen, SerializerProvider provider, TypeSerializer typeSer) throws java.io.IOException
Description copied from interface:JsonSerializable
Serialization 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(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)
followed by serialization of contents, followed by a call toTypeSerializer.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.
- Specified by:
serializeWithType
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
serialize
public void serialize(JsonGenerator gen, SerializerProvider provider) throws java.io.IOException
Description copied from interface:JsonSerializable
Serialization method called when no additional type information is to be included in serialization.- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
-
getFunction
public java.lang.String getFunction()
-
getValue
public java.lang.Object getValue()
-
getSerializationType
public JavaType getSerializationType()
-
-