Class NullRespectingJSONSerializer

  extended by<Object>
      extended by

public class NullRespectingJSONSerializer

This serializer writes field-name : null, for java bean fields that are a null reference; otherwise, it uses the default JSON serialization strategy for that field. This is neccesary because we are in a version of Jackson that is stupid and tells you that by default it will serialize null references as field-name : null but it actually does not include the field in the generated JSON at all. Explicit serialization settings do not work either, so we have to force this behaviour through this custom serializer :-(

Nested Class Summary
Nested classes/interfaces inherited from class
Constructor Summary
Method Summary
protected static boolean isPublic(Field field)
 void serialize(Object object, org.codehaus.jackson.JsonGenerator jgen, provider)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public NullRespectingJSONSerializer()
Method Detail


public void serialize(Object object,
                      org.codehaus.jackson.JsonGenerator jgen,
               throws IOException
Specified by:
serialize in class<Object>


protected static boolean isPublic(Field field)

Copyright © 2002-2012 Atlassian. All Rights Reserved.