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

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

Introduction

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

Usage

From source file com.feed_the_beast.javacurselib.utils.BetterEnumAdapterFactory.java

public class BetterEnumAdapterFactory implements TypeAdapterFactory {
    //@SuppressWarnings({"rawtypes", "unchecked"})
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
        Class<? super T> rawType = typeToken.getRawType();
        if (!Enum.class.isAssignableFrom(rawType) || rawType == Enum.class) {

From source file com.flipkart.android.proteus.gson.ProteusTypeAdapterFactory.java

/**
 * ProteusTypeAdapterFactory
 *
 * @author aditya.sharat
 */
public class ProteusTypeAdapterFactory implements TypeAdapterFactory {

From source file com.flipkart.batching.gson.adapters.BatchingTypeAdapterFactory.java

public class BatchingTypeAdapterFactory implements TypeAdapterFactory {
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
        Class<? super T> rawType = type.getRawType();
        if (rawType.isAssignableFrom(JSONObject.class)) {
            return (TypeAdapter<T>) BatchingTypeAdapters.getJSONObjectTypeAdapter(gson);

From source file com.flipkart.batching.gson.RuntimeTypeAdapterFactory.java

public final class RuntimeTypeAdapterFactory<T> implements TypeAdapterFactory {
    private final Class<?> baseType;
    private final Map<Class<?>, String> subtypeToLabel = new LinkedHashMap<>();
    private final Map<String, Class<?>> labelToSubtype = new LinkedHashMap<>();
    private final Map<String, TypeAdapter<? extends T>> labelToTypeAdapter = new LinkedHashMap<>();

From source file com.fpt.router.artifacter.json.RuntimeTypeAdapterFactory.java

/**
 * Adapts values whose runtime pathType may differ from their declaration pathType. This
 * is necessary when a field's pathType is not the same pathType that GSON should create
 * when deserializing that field. For example, consider these types:
 * <pre>   {@code
 *   abstract class Shape {

From source file com.gilecode.yagson.adapters.ThreadTypesAdapterFactory.java

/**
 * Provides type adapters for {@link Thread}, {@link ThreadGroup} and {@link ThreadLocal}s.
 * <p/>
 * Threads and thread groups are serialized by their full names (starting from the root thread group).
 * <p/>
 * For thread locals, only the value for the current thread is stored. Deserialized thread locals are always

From source file com.github.filosganga.geogson.gson.GeometryAdapterFactory.java

/**
 * The Gson TypeAdapterFactory responsible to serialize/de-serialize all the {@link Geometry}, {@link Feature}
 * and {@link FeatureCollection} instances.
 */
public class GeometryAdapterFactory implements TypeAdapterFactory {

From source file com.github.gfx.android.orma.gson.SingleAssociationTypeAdapterFactory.java

/**
 * A Gson {@link TypeAdapterFactory} to handle Orma {@link SingleAssociation}.
 */
public class SingleAssociationTypeAdapterFactory implements TypeAdapterFactory {

    @Override

From source file com.github.jtail.sterren.ValidatingAdapterFactory.java

@AllArgsConstructor
public class ValidatingAdapterFactory implements TypeAdapterFactory {
    private final Validator validator;
    private final ViolationConverter converter;

    public ValidatingAdapterFactory() {

From source file com.github.kyriosdata.regras.infraestrutura.CustomRegraTypeAdapterFactory.java

public class CustomRegraTypeAdapterFactory implements TypeAdapterFactory {

    private String[] classes = { "RegraExpressao", "RegraPontosPorRelato" };
    private String[] tipos = { "expressao", "pontosPorRelato" };

    private String getTipo(String className) {