org.codehaus.jackson.map.ser
Class ContainerSerializers.CollectionSerializer

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.ContainerSerializers.AsArraySerializer<Collection<?>>
                  extended by org.codehaus.jackson.map.ser.ContainerSerializers.CollectionSerializer
All Implemented Interfaces:
ResolvableSerializer, SchemaAware
Enclosing class:
ContainerSerializers

public static class ContainerSerializers.CollectionSerializer
extends ContainerSerializers.AsArraySerializer<Collection<?>>

Fallback serializer for cases where Collection is not known to be of type for which more specializer serializer exists (such as index-accessible List). If so, we will just construct an Iterator to iterate over elements.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer
JsonSerializer.None
 
Field Summary
 
Fields inherited from class org.codehaus.jackson.map.ser.ContainerSerializers.AsArraySerializer
_dynamicSerializers, _elementSerializer, _elementType, _property, _staticTyping, _valueTypeSerializer
 
Fields inherited from class org.codehaus.jackson.map.ser.SerializerBase
_handledType
 
Constructor Summary
ContainerSerializers.CollectionSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property)
          Deprecated. since 1.8
ContainerSerializers.CollectionSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, BeanProperty property, JsonSerializer<Object> valueSerializer)
           
 
Method Summary
 ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
           
 void serializeContents(Collection<?> value, JsonGenerator jgen, SerializerProvider provider)
           
 void serializeContentsUsing(Collection<?> value, JsonGenerator jgen, SerializerProvider provider, JsonSerializer<Object> ser)
           
 
Methods inherited from class org.codehaus.jackson.map.ser.ContainerSerializers.AsArraySerializer
_findAndAddDynamic, _findAndAddDynamic, getSchema, resolve, serialize, serializeWithType
 
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, isDefaultSerializer, wrapAndThrow, wrapAndThrow, wrapAndThrow, wrapAndThrow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerSerializers.CollectionSerializer

@Deprecated
public ContainerSerializers.CollectionSerializer(JavaType elemType,
                                                            boolean staticTyping,
                                                            TypeSerializer vts,
                                                            BeanProperty property)
Deprecated. since 1.8


ContainerSerializers.CollectionSerializer

public ContainerSerializers.CollectionSerializer(JavaType elemType,
                                                 boolean staticTyping,
                                                 TypeSerializer vts,
                                                 BeanProperty property,
                                                 JsonSerializer<Object> valueSerializer)
Method Detail

_withValueTypeSerializer

public ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
Specified by:
_withValueTypeSerializer in class ContainerSerializerBase<Collection<?>>

serializeContents

public void serializeContents(Collection<?> value,
                              JsonGenerator jgen,
                              SerializerProvider provider)
                       throws IOException,
                              JsonGenerationException
Specified by:
serializeContents in class ContainerSerializers.AsArraySerializer<Collection<?>>
Throws:
IOException
JsonGenerationException

serializeContentsUsing

public void serializeContentsUsing(Collection<?> value,
                                   JsonGenerator jgen,
                                   SerializerProvider provider,
                                   JsonSerializer<Object> ser)
                            throws IOException,
                                   JsonGenerationException
Throws:
IOException
JsonGenerationException