Package org.codehaus.jackson.map.ser.std
Class ObjectArraySerializer
- java.lang.Object
-
- org.codehaus.jackson.map.JsonSerializer<T>
-
- org.codehaus.jackson.map.ser.std.SerializerBase<T>
-
- org.codehaus.jackson.map.ser.std.ContainerSerializerBase<T>
-
- org.codehaus.jackson.map.ser.std.StdArraySerializers.ArraySerializerBase<Object[]>
-
- org.codehaus.jackson.map.ser.std.ObjectArraySerializer
-
- All Implemented Interfaces:
ResolvableSerializer
,SchemaAware
public class ObjectArraySerializer extends StdArraySerializers.ArraySerializerBase<Object[]> implements ResolvableSerializer
Generic serializer for Object arrays (Object[]
).- Since:
- 1.9 (moved from 'org.codehaus.jackson.map.ser.impl.ObjectArraySerializer')
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer
JsonSerializer.None
-
-
Field Summary
Fields Modifier and Type Field Description protected PropertySerializerMap
_dynamicSerializers
If element type can not be statically determined, mapping from runtime type to serializer is handled using this objectprotected JsonSerializer<Object>
_elementSerializer
Value serializer to use, if it can be statically determined.protected JavaType
_elementType
Declared type of element entriesprotected boolean
_staticTyping
Whether we are using static typing (using declared types, ignoring runtime type) or not for elements.-
Fields inherited from class org.codehaus.jackson.map.ser.std.StdArraySerializers.ArraySerializerBase
_property, _valueTypeSerializer
-
Fields inherited from class org.codehaus.jackson.map.ser.std.SerializerBase
_handledType
-
-
Constructor Summary
Constructors Constructor Description ObjectArraySerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property)
Deprecated.since 1.8ObjectArraySerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> elementSerializer)
-
Method Summary
-
Methods inherited from class org.codehaus.jackson.map.ser.std.StdArraySerializers.ArraySerializerBase
serialize, serializeWithType
-
Methods inherited from class org.codehaus.jackson.map.ser.std.ContainerSerializerBase
withValueTypeSerializer
-
Methods inherited from class org.codehaus.jackson.map.ser.std.SerializerBase
createObjectNode, createSchemaNode, createSchemaNode, handledType, isDefaultSerializer, wrapAndThrow, wrapAndThrow, wrapAndThrow, wrapAndThrow
-
Methods inherited from class org.codehaus.jackson.map.JsonSerializer
isUnwrappingSerializer, unwrappingSerializer
-
-
-
-
Field Detail
-
_staticTyping
protected final boolean _staticTyping
Whether we are using static typing (using declared types, ignoring runtime type) or not for elements.
-
_elementType
protected final JavaType _elementType
Declared type of element entries
-
_elementSerializer
protected JsonSerializer<Object> _elementSerializer
Value serializer to use, if it can be statically determined.- Since:
- 1.5
-
_dynamicSerializers
protected PropertySerializerMap _dynamicSerializers
If element type can not be statically determined, mapping from runtime type to serializer is handled using this object- Since:
- 1.7
-
-
Constructor Detail
-
ObjectArraySerializer
@Deprecated public ObjectArraySerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property)
Deprecated.since 1.8
-
ObjectArraySerializer
public ObjectArraySerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> elementSerializer)
-
-
Method Detail
-
_withValueTypeSerializer
public ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
- Specified by:
_withValueTypeSerializer
in classContainerSerializerBase<Object[]>
-
serializeContents
public void serializeContents(Object[] value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Specified by:
serializeContents
in classStdArraySerializers.ArraySerializerBase<Object[]>
- Throws:
IOException
JsonGenerationException
-
serializeContentsUsing
public void serializeContentsUsing(Object[] value, JsonGenerator jgen, SerializerProvider provider, JsonSerializer<Object> ser) throws IOException, JsonGenerationException
- Throws:
IOException
JsonGenerationException
-
serializeTypedContents
public void serializeTypedContents(Object[] value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Throws:
IOException
JsonGenerationException
-
getSchema
public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException
Description copied from class:SerializerBase
Note: since Jackson 1.9, default implementation claims type is "string"- Specified by:
getSchema
in interfaceSchemaAware
- Overrides:
getSchema
in classSerializerBase<Object[]>
- Parameters:
provider
- The serializer provider.typeHint
- A hint about the type.- Returns:
- Json-schema for this serializer.
- Throws:
JsonMappingException
-
resolve
public void resolve(SerializerProvider provider) throws JsonMappingException
Need to get callback to resolve value serializer, if static typing is used (either being forced, or because value type is final)- Specified by:
resolve
in interfaceResolvableSerializer
- Parameters:
provider
- Provider that has constructed serializer this method is called on.- Throws:
JsonMappingException
-
_findAndAddDynamic
protected final JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializerProvider provider) throws JsonMappingException
- Throws:
JsonMappingException
- Since:
- 1.7
-
_findAndAddDynamic
protected final JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, JavaType type, SerializerProvider provider) throws JsonMappingException
- Throws:
JsonMappingException
- Since:
- 1.8
-
-