Example usage for com.google.gson TypeAdapter subclass-usage

List of usage examples for com.google.gson TypeAdapter subclass-usage

Introduction

In this page you can find the example usage for com.google.gson TypeAdapter subclass-usage.

Usage

From source file my.test.support.JSON.java

/**
 * Gson TypeAdapter for Joda DateTime type
 */
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file net.bpiwowar.experimaestro.tasks.ReaderTypeAdapter.java

/**
 * Created by bpiwowar on 7/10/14.
 */
abstract public class ReaderTypeAdapter<T> extends TypeAdapter<T> {
    @Override
    public void write(JsonWriter out, T value) throws IOException {

From source file net.derquinse.common.gson.GsonByteString.java

/**
 * Gson representation for {@link ByteString}.
 * @author Andres Rodriguez
 */
public final class GsonByteString extends TypeAdapter<ByteString> {
    /** Constructor. */

From source file net.derquinse.common.gson.GsonHashCode.java

/**
 * Gson representation for {@link HashCode}.
 * @author Andres Rodriguez
 */
public final class GsonHashCode extends TypeAdapter<HashCode> {
    /** Constructor. */

From source file net.feed_the_beast.launcher.json.FileAdapter.java

public class FileAdapter extends TypeAdapter<File> {

    @Override
    public File read(JsonReader json) throws IOException {
        if (json.hasNext()) {
            String value = json.nextString();

From source file net.friendscraft_2_launch.launcher.json.FileAdapter.java

public class FileAdapter extends TypeAdapter<File> {

    @Override
    public File read(JsonReader json) throws IOException {
        if (json.hasNext()) {
            String value = json.nextString();

From source file net.ftb.jsonlib.adapters.FileAdapter.java

public class FileAdapter extends TypeAdapter<File> {

    @Override
    public File read(JsonReader json) throws IOException {
        if (json.hasNext()) {
            String value = json.nextString();

From source file net.ilexiconn.magister.adapter.AppointmentAdapter.java

public class AppointmentAdapter extends TypeAdapter<Appointment[]> {
    private static Gson gson;

    static {
        Map<Class<?>, TypeAdapter<?>> map = new HashMap<Class<?>, TypeAdapter<?>>();
        map.put(AppointmentType.class, new AppointmentTypeAdapter());

From source file net.ilexiconn.magister.adapter.ArrayAdapter.java

public class ArrayAdapter<T> extends TypeAdapter<T[]> {
    public Gson gson = GsonUtil.getGson();
    public Class<T> cls;
    public Class<? extends T[]> clsArray;

    public ArrayAdapter(Class<T> cls, Class<? extends T[]> clsArray) {

From source file net.ilexiconn.magister.adapter.GradeAdapter.java

public class GradeAdapter extends TypeAdapter<Grade[]> {
    public Gson gson = GsonUtil.getGsonWithAdapter(RowType.class, new RowTypeAdapter());

    @Override
    public void write(JsonWriter out, Grade[] value) throws IOException {
        throw new UnsupportedOperationException("Not implemented");