public class JSONPObject extends java.lang.Object implements JsonSerializable
JSONWrappedObjectJsonSerializable.Base| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_function
JSONP function name to use for serialization
|
protected JavaType |
_serializationType
Optional static type to use for serialization; if null, runtime
type is used.
|
protected java.lang.Object |
_value
Value to be serialized as JSONP padded; can be null.
|
| Constructor and Description |
|---|
JSONPObject(java.lang.String function,
java.lang.Object value) |
JSONPObject(java.lang.String function,
java.lang.Object value,
JavaType asType) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getFunction() |
JavaType |
getSerializationType() |
java.lang.Object |
getValue() |
void |
serialize(com.fasterxml.jackson.core.JsonGenerator gen,
SerializerProvider provider)
Serialization method called when no additional type information is
to be included in serialization.
|
void |
serializeWithType(com.fasterxml.jackson.core.JsonGenerator gen,
SerializerProvider provider,
TypeSerializer typeSer)
Serialization method called when additional type information is
expected to be included in serialization, for deserialization to use.
|
protected final java.lang.String _function
protected final java.lang.Object _value
protected final JavaType _serializationType
public JSONPObject(java.lang.String function,
java.lang.Object value)
public JSONPObject(java.lang.String function,
java.lang.Object value,
JavaType asType)
public void serializeWithType(com.fasterxml.jackson.core.JsonGenerator gen,
SerializerProvider provider,
TypeSerializer typeSer)
throws java.io.IOException
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 JsonSerializablejava.io.IOExceptionpublic void serialize(com.fasterxml.jackson.core.JsonGenerator gen,
SerializerProvider provider)
throws java.io.IOException
JsonSerializableserialize in interface JsonSerializablejava.io.IOExceptionpublic java.lang.String getFunction()
public java.lang.Object getValue()
public JavaType getSerializationType()