Class DefaultJsonator

java.lang.Object
com.atlassian.bamboo.jsonator.DefaultJsonator
All Implemented Interfaces:
Jsonator<Object>

public class DefaultJsonator extends Object implements Jsonator<Object>
Converts a Java Bean to a JSON object. Delegates to correct ObjectJsonator.
  • Constructor Details

    • DefaultJsonator

      public DefaultJsonator()
  • Method Details

    • convert

      public com.google.gson.JsonElement convert(Object object)
      Description copied from interface: Jsonator
      Creates a JsonElement representation of a given object. Enums are converted to their names.
      Specified by:
      convert in interface Jsonator<Object>
      Parameters:
      object - the object to be serialized
      Returns:
      Json JSON representation of the given object
    • convert

      public Function<Object,com.google.gson.JsonElement> convert()
      Specified by:
      convert in interface Jsonator<Object>
      Returns:
      a function to map objects to their JsonElements representation. Enums are converted to their names.
    • convert

      public com.google.gson.JsonElement convert(Object object, Jsonator.EnumConversionMode enumConversionMode)
      Description copied from interface: Jsonator
      Creates a JsonElement representation of a given object
      Specified by:
      convert in interface Jsonator<Object>
      Parameters:
      object - the object to be serialized
      enumConversionMode - defines enum handling
      Returns:
      Json JSON representation of the given object