com.atlassian.bamboo.jsonator
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
.
Method Summary |
com.google.common.base.Function<Object,com.google.gson.JsonElement> |
convert()
|
com.google.gson.JsonElement |
convert(Object object)
Creates a JsonElement representation of a given object. |
com.google.gson.JsonElement |
convert(Object object,
Jsonator.EnumConversionMode enumConversionMode)
Creates a JsonElement representation of a given object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultJsonator
public DefaultJsonator()
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 com.google.common.base.Function<Object,com.google.gson.JsonElement> convert()
- Specified by:
convert
in interface Jsonator<Object>
- Returns:
- a function to map objects to their
JsonElement
s 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 serializedenumConversionMode
- defines enum handling
- Returns:
- Json JSON representation of the given object
Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.