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

java.lang.Object
  extended by org.codehaus.jackson.map.JsonSerializer<java.util.Collection<?>>
      extended by org.codehaus.jackson.map.ser.ContainerSerializers.CollectionSerializer
Enclosing class:
ContainerSerializers

public static final class ContainerSerializers.CollectionSerializer
extends JsonSerializer<java.util.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.


Field Summary
static ContainerSerializers.CollectionSerializer instance
           
 
Constructor Summary
ContainerSerializers.CollectionSerializer()
           
 
Method Summary
 void serialize(java.util.Collection<?> value, JsonGenerator jgen, SerializerProvider provider)
          Method that can be called to ask implementation to serialize values of type this serializer handles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static final ContainerSerializers.CollectionSerializer instance
Constructor Detail

ContainerSerializers.CollectionSerializer

public ContainerSerializers.CollectionSerializer()
Method Detail

serialize

public void serialize(java.util.Collection<?> value,
                      JsonGenerator jgen,
                      SerializerProvider provider)
               throws java.io.IOException,
                      JsonGenerationException
Description copied from class: JsonSerializer
Method that can be called to ask implementation to serialize values of type this serializer handles.

Specified by:
serialize in class JsonSerializer<java.util.Collection<?>>
Parameters:
value - Value to serialize; can not be null.
jgen - Generator used to output resulting Json content
provider - Provider that can be used to get serializers for serializing Objects value contains, if any.
Throws:
java.io.IOException
JsonGenerationException