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 edu.mit.media.funf.config.ConfigurableTypeAdapterFactory.java

public class ConfigurableTypeAdapterFactory implements TypeAdapterFactory {
    private ReflectiveTypeAdapterFactory delegate;

    public ConfigurableTypeAdapterFactory() {
        delegate = new ReflectiveTypeAdapterFactory(new ConstructorConstructor(),
                new ConfigurableFieldNamingStrategy(),

From source file edu.mit.media.funf.config.ContextInjectorTypeAdapaterFactory.java

public class ContextInjectorTypeAdapaterFactory implements TypeAdapterFactory {

    public static final String CONTEXT_FIELD = "context";

    private Context context;
    private TypeAdapterFactory delegate;

From source file edu.mit.media.funf.config.ListenerInjectorTypeAdapterFactory.java

public class ListenerInjectorTypeAdapterFactory implements TypeAdapterFactory {

    private TypeAdapterFactory delegate;

    public ListenerInjectorTypeAdapterFactory(TypeAdapterFactory delegate) {
        this.delegate = delegate;

From source file edu.mit.media.funf.config.RuntimeTypeAdapterFactory.java

public interface RuntimeTypeAdapterFactory extends TypeAdapterFactory {

    public static final String TYPE = "@type";

    public <T> Class<? extends T> getRuntimeType(final JsonElement el, final TypeToken<T> type);
}

From source file edu.mit.media.funf.config.SingletonTypeAdapterFactory.java

/**
 * Same configuration should return the same object.  
 * A cache of each object created is kept to ensure this.
 * 
 * TODO: should probably have weak refs, so that we can garbage collect unused items.
 * 

From source file forms.util.RuntimeTypeAdapterFactory.java

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

From source file fr.kvaternik.adrien.bookstore.model.service.adapterfactory.RuntimeTypeAdapterFactory.java

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

From source file funf.config.ConfigurableTypeAdapterFactory.java

public class ConfigurableTypeAdapterFactory implements TypeAdapterFactory {
    private ReflectiveTypeAdapterFactory delegate;

    public ConfigurableTypeAdapterFactory() {
        delegate = new ReflectiveTypeAdapterFactory(new ConstructorConstructor(),
                new ConfigurableFieldNamingStrategy(),

From source file funf.config.ContextInjectorTypeAdapaterFactory.java

public class ContextInjectorTypeAdapaterFactory implements TypeAdapterFactory {

    public static final String CONTEXT_FIELD = "context";

    private Context context;
    private TypeAdapterFactory delegate;

From source file funf.config.RuntimeTypeAdapterFactory.java

public interface RuntimeTypeAdapterFactory extends TypeAdapterFactory {

    public static final String TYPE = "@type";

    public <T> Class<? extends T> getRuntimeType(final JsonElement el, final TypeToken<T> type);
}