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_dynamicSerializersIf element type can not be statically determined, mapping from runtime type to serializer is handled using this objectprotected JsonSerializer<Object>_elementSerializerValue serializer to use, if it can be statically determined.protected JavaType_elementTypeDeclared type of element entriesprotected boolean_staticTypingWhether 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:
_withValueTypeSerializerin classContainerSerializerBase<Object[]>
-
serializeContents
public void serializeContents(Object[] value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Specified by:
serializeContentsin classStdArraySerializers.ArraySerializerBase<Object[]>- Throws:
IOExceptionJsonGenerationException
-
serializeContentsUsing
public void serializeContentsUsing(Object[] value, JsonGenerator jgen, SerializerProvider provider, JsonSerializer<Object> ser) throws IOException, JsonGenerationException
- Throws:
IOExceptionJsonGenerationException
-
serializeTypedContents
public void serializeTypedContents(Object[] value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
- Throws:
IOExceptionJsonGenerationException
-
getSchema
public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException
Description copied from class:SerializerBaseNote: since Jackson 1.9, default implementation claims type is "string"- Specified by:
getSchemain interfaceSchemaAware- Overrides:
getSchemain 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:
resolvein 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
-
-