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 net.oneandone.stool.configuration.adapter.VersionTypeAdapter.java

public class VersionTypeAdapter extends TypeAdapter<Version> {
    @Override
    public void write(JsonWriter out, Version value) throws IOException {
        out.value(value.toString());
    }

From source file nextflow.ga4gh.tes.client.JSON.java

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

    private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser();

From source file nl.esciencecenter.e3dchem.gpcrdb.client.JSON.java

/**
 * Gson TypeAdapter for jsr310 OffsetDateTime type
 */
class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {

    private final DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;

From source file no.uis.service.ws.studinfosolr.impl.XmlElementAdapter.java

/**
 * Gson Type Adapter for XML nodes.
 */
public class XmlElementAdapter extends TypeAdapter<ElementImpl> {

    @Override

From source file no.uis.service.ws.studinfosolr.json.CalendarSerializer.java

/**
 * A Json Type adapter for a <code>XMLGregorianCalendar</code>.
 */
public class CalendarSerializer extends TypeAdapter<XMLGregorianCalendar> {

    public static String convertToSolrString(XMLGregorianCalendar xcal) {

From source file no.uis.service.ws.studinfosolr.json.FagpersonSerializer.java

/**
 * A Json type adapter for {@link Fagperson}.
 */
public class FagpersonSerializer extends TypeAdapter<Fagperson> {

    @Override

From source file no.uis.service.ws.studinfosolr.json.FsEksamensdatoSerializer.java

/**
 * A Json Type adapter for {@link FsEksamensdato}.
 */
public class FsEksamensdatoSerializer extends TypeAdapter<FsEksamensdato> {

    @Override

From source file nz.ac.otago.psyanlab.common.model.util.LongSparseArrayGsonAdapter.java

/**
 * Coerces long sparse array items to specified type. However, is not compatible
 * with abstract types.
 * 
 * @param <T> Type to coerce items to.
 */

From source file one.talon.api.JSON.java

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

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file ooo.oxo.moments.net.TimestampTypeAdapter.java

public class TimestampTypeAdapter extends TypeAdapter<Date> {

    @Override
    public void write(JsonWriter out, Date value) throws IOException {
        if (value == null) {
            out.nullValue();