org.codehaus.jackson.map.ser
Class ArraySerializers.ObjectArraySerializer

java.lang.Object
  extended by org.codehaus.jackson.map.JsonSerializer<T>
      extended by org.codehaus.jackson.map.ser.SerializerBase<T>
          extended by org.codehaus.jackson.map.ser.ContainerSerializerBase<T>
              extended by org.codehaus.jackson.map.ser.ArraySerializers.ObjectArraySerializer
All Implemented Interfaces:
ResolvableSerializer, SchemaAware
Enclosing class:
ArraySerializers

public static final class ArraySerializers.ObjectArraySerializer
extends ContainerSerializerBase<T>
implements ResolvableSerializer

Generic serializer for Object arrays (Object[]).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer
JsonSerializer.None
 
Field Summary
protected  JsonSerializer<Object> _elementSerializer
          Value serializer to use, if it can be statically determined
protected  JavaType _elementType
           
protected  boolean _staticTyping
           
static ArraySerializers.ObjectArraySerializer instance
           
 
Fields inherited from class org.codehaus.jackson.map.ser.SerializerBase
_handledType
 
Constructor Summary
ArraySerializers.ObjectArraySerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts)
           
 
Method Summary
 ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
           
 JsonNode getSchema(SerializerProvider provider, Type typeHint)
          Get the representation of the schema to which this serializer will conform.
 void resolve(SerializerProvider provider)
          Need to get callback to resolve value serializer, if static typing is used (either being forced, or because value type is final)
 void serializeContents(Object[] value, JsonGenerator jgen, SerializerProvider provider)
           
 void serializeContentsUsing(Object[] value, JsonGenerator jgen, SerializerProvider provider, JsonSerializer<Object> ser)
           
 void serializeTypedContents(Object[] value, JsonGenerator jgen, SerializerProvider provider)
           
 
Methods inherited from class org.codehaus.jackson.map.ser.ContainerSerializerBase
withValueTypeSerializer
 
Methods inherited from class org.codehaus.jackson.map.ser.SerializerBase
createObjectNode, createSchemaNode, createSchemaNode, handledType, wrapAndThrow, wrapAndThrow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final ArraySerializers.ObjectArraySerializer instance

_staticTyping

protected final boolean _staticTyping

_elementType

protected final JavaType _elementType

_elementSerializer

protected JsonSerializer<Object> _elementSerializer
Value serializer to use, if it can be statically determined

Since:
1.5
Constructor Detail

ArraySerializers.ObjectArraySerializer

public ArraySerializers.ObjectArraySerializer(JavaType elemType,
                                              boolean staticTyping,
                                              TypeSerializer vts)
Method Detail

_withValueTypeSerializer

public ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
Specified by:
_withValueTypeSerializer in class ContainerSerializerBase<Object[]>

serializeContents

public void serializeContents(Object[] value,
                              JsonGenerator jgen,
                              SerializerProvider provider)
                       throws IOException,
                              JsonGenerationException
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 interface: SchemaAware
Get the representation of the schema to which this serializer will conform.

Specified by:
getSchema in interface SchemaAware
Specified by:
getSchema in class SerializerBase<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 interface ResolvableSerializer
Parameters:
provider - Provider that has constructed serializer this method is called on.
Throws:
JsonMappingException