Package org.codehaus.jackson.map.util
Class JSONPObject
java.lang.Object
org.codehaus.jackson.map.util.JSONPObject
- All Implemented Interfaces:
JsonSerializable
,JsonSerializableWithType
Container class that can be used to wrap any Object instances (including
nulls), and will serialize embedded in
JSONP wrapping.
- Since:
- 1.5
- Author:
- tatu
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJSONPObject
(String function, Object value) JSONPObject
(String function, Object value, Class<?> rawType) Deprecated.Since 1.8; instead use variant that takes JavaType: this ensures that type information is properly resolvedJSONPObject
(String function, Object value, JavaType asType) -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
void
serialize
(JsonGenerator jgen, SerializerProvider provider) void
serializeWithType
(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer)
-
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
-
JSONPObject
Deprecated.Since 1.8; instead use variant that takes JavaType: this ensures that type information is properly resolved
-
-
Method Details
-
serializeWithType
public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException - Specified by:
serializeWithType
in interfaceJsonSerializableWithType
- Throws:
IOException
JsonProcessingException
-
serialize
public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
JsonProcessingException
-
getFunction
-
getValue
-
getSerializationType
-