com.atlassian.bamboo.jsonator
Interface Jsonator<T>

All Known Implementing Classes:
DefaultJsonator

public interface Jsonator<T>

Interface to implement if you want to provide a method to create a JSON representation of an object


Nested Class Summary
static class Jsonator.EnumConversionMode
          Defines handling of Java enums during Object to JSON conversion.
 
Method Summary
 com.google.gson.JsonElement convert(T object)
          Creates a JsonElement representation of a given object.
 com.google.gson.JsonElement convert(T object, Jsonator.EnumConversionMode enumConversionMode)
          Creates a JsonElement representation of a given object
 

Method Detail

convert

com.google.gson.JsonElement convert(T object)
Creates a JsonElement representation of a given object. Enums are converted to their names.

Parameters:
object - the object to be serialized
Returns:
Json JSON representation of the given object

convert

com.google.gson.JsonElement convert(T object,
                                    Jsonator.EnumConversionMode enumConversionMode)
Creates a JsonElement representation of a given object

Parameters:
object - the object to be serialized
enumConversionMode - defines enum handling
Returns:
Json JSON representation of the given object


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.