Spring Hateoas

org.springframework.hateoas.hal
Class Jackson1HalModule.OptionalListSerializer

java.lang.Object
  extended by org.codehaus.jackson.map.JsonSerializer<T>
      extended by org.codehaus.jackson.map.ser.std.SerializerBase<T>
          extended by org.codehaus.jackson.map.ser.std.ContainerSerializerBase<Object>
              extended by org.springframework.hateoas.hal.Jackson1HalModule.OptionalListSerializer
All Implemented Interfaces:
org.codehaus.jackson.schema.SchemaAware
Enclosing class:
Jackson1HalModule

public static class Jackson1HalModule.OptionalListSerializer
extends org.codehaus.jackson.map.ser.std.ContainerSerializerBase<Object>

Custom JsonSerializer to render Objects in HAL compatible JSON. Renders the Object as immediate object if we have a single one or as array if we have multiple ones.

Author:
Alexander Baetz, Oliver Gierke

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer
org.codehaus.jackson.map.JsonSerializer.None
 
Field Summary
 
Fields inherited from class org.codehaus.jackson.map.ser.std.SerializerBase
_handledType
 
Constructor Summary
Jackson1HalModule.OptionalListSerializer()
           
Jackson1HalModule.OptionalListSerializer(org.codehaus.jackson.map.BeanProperty property)
           
 
Method Summary
 org.codehaus.jackson.map.ser.std.ContainerSerializerBase<?> _withValueTypeSerializer(org.codehaus.jackson.map.TypeSerializer vts)
           
 void serialize(Object value, org.codehaus.jackson.JsonGenerator jgen, org.codehaus.jackson.map.SerializerProvider provider)
           
 
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, getSchema, handledType, isDefaultSerializer, wrapAndThrow, wrapAndThrow, wrapAndThrow, wrapAndThrow
 
Methods inherited from class org.codehaus.jackson.map.JsonSerializer
isUnwrappingSerializer, serializeWithType, unwrappingSerializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jackson1HalModule.OptionalListSerializer

public Jackson1HalModule.OptionalListSerializer()

Jackson1HalModule.OptionalListSerializer

public Jackson1HalModule.OptionalListSerializer(org.codehaus.jackson.map.BeanProperty property)
Method Detail

_withValueTypeSerializer

public org.codehaus.jackson.map.ser.std.ContainerSerializerBase<?> _withValueTypeSerializer(org.codehaus.jackson.map.TypeSerializer vts)
Specified by:
_withValueTypeSerializer in class org.codehaus.jackson.map.ser.std.ContainerSerializerBase<Object>

serialize

public void serialize(Object value,
                      org.codehaus.jackson.JsonGenerator jgen,
                      org.codehaus.jackson.map.SerializerProvider provider)
               throws IOException,
                      org.codehaus.jackson.JsonGenerationException
Specified by:
serialize in class org.codehaus.jackson.map.ser.std.SerializerBase<Object>
Throws:
IOException
org.codehaus.jackson.JsonGenerationException

Spring Hateoas

Copyright © 2012-2014 Pivotal, Inc.. All Rights Reserved.