Example usage for com.google.gson JsonSerializer interface-usage

List of usage examples for com.google.gson JsonSerializer interface-usage

Introduction

In this page you can find the example usage for com.google.gson JsonSerializer interface-usage.

Usage

From source file com.claresco.tinman.json.XapiSubStatementJson.java

/**
 * XapiSubStatementDeserializer.java
 *
 *
 *
 *

From source file com.claresco.tinman.json.XapiVerbJson.java

/**
 * XapiVerbDeserializer.java
 *
 *
 *
 *

From source file com.cloud.agent.transport.ArrayTypeAdaptor.java

public class ArrayTypeAdaptor<T> implements JsonDeserializer<T[]>, JsonSerializer<T[]> {

    protected Gson _gson = null;

    private static final String s_pkg = Command.class.getPackage().getName() + ".";

From source file com.cloud.agent.transport.VolListTypeAdaptor.java

public class VolListTypeAdaptor implements JsonDeserializer<List<VolumeVO>>, JsonSerializer<List<VolumeVO>> {
    static final GsonBuilder s_gBuilder;
    static {
        s_gBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
    }

From source file com.cloud.api.EncodedStringTypeAdapter.java

public class EncodedStringTypeAdapter implements JsonSerializer<String> {
    public static final Logger s_logger = Logger.getLogger(EncodedStringTypeAdapter.class.getName());

    @Override
    public JsonElement serialize(String src, Type typeOfResponseObj, JsonSerializationContext ctx) {
        return new JsonPrimitive(encodeString(src));

From source file com.cloud.api.IdentityTypeAdapter.java

public class IdentityTypeAdapter implements JsonSerializer<IdentityProxy>, JsonDeserializer<IdentityProxy> {

    @Override
    public JsonElement serialize(IdentityProxy src, Type srcType, JsonSerializationContext context) {
        if (SerializationContext.current().getUuidTranslation()) {
            assert (src != null);

From source file com.cloud.api.ResponseObjectTypeAdapter.java

public class ResponseObjectTypeAdapter implements JsonSerializer<ResponseObject> {
    public static final Logger s_logger = Logger.getLogger(ResponseObjectTypeAdapter.class.getName());

    @Override
    public JsonElement serialize(ResponseObject responseObj, Type typeOfResponseObj, JsonSerializationContext ctx) {
        JsonObject obj = new JsonObject();

From source file com.codereligion.bugsnag.logback.resource.MetaDataVOSerializer.java

/**
 * Custom {@link JsonSerializer} for {@link MetaDataVO}s which directly serializes the underlying data structure.
 *
 * @author Sebastian Grbler
 */
public class MetaDataVOSerializer implements JsonSerializer<MetaDataVO> {

From source file com.codereligion.bugsnag.logback.resource.TabVOSerializer.java

/**
 * Custom {@link JsonSerializer} for {@link TabVO}s which directly serializes the underlying data structure.
 *
 * <p/>Additionally this serializer filters out specified key/value pairs according to the given
 * {@link JsonFilterProvider}.
 *

From source file com.cognifide.aet.vs.metadata.CollectionSerializer.java

class CollectionSerializer implements JsonSerializer<Collection<?>> {

    @Override
    public JsonElement serialize(Collection<?> src, Type typeOfSrc, JsonSerializationContext context) {
        if (src == null || src.isEmpty()) {
            return null;