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 org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapter.java

/**
 * A specialized type adapter for collections that can handle single values.
 */
public class CollectionTypeAdapter<E> extends TypeAdapter<Collection<E>> {

    public static class Factory implements TypeAdapterFactory {

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapter.java

/**
 * Type adapter for {@link Either} and {@link Either3}.
 */
public class EitherTypeAdapter<L, R> extends TypeAdapter<Either<L, R>> {

    public static class Factory implements TypeAdapterFactory {

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.EnumTypeAdapter.java

/**
 * A custom type adapter for enums that uses integer values.
 */
public class EnumTypeAdapter<T extends Enum<T>> extends TypeAdapter<T> {

    public static class Factory implements TypeAdapterFactory {

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.JsonElementTypeAdapter.java

/**
 * A type adapter that reads every input into a tree of {@link JsonElement}s.
 */
public class JsonElementTypeAdapter extends TypeAdapter<Object> {

    /**

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.java

/**
 * The type adapter for messages dispatches between the different message types: {@link RequestMessage},
 * {@link ResponseMessage}, and {@link NotificationMessage}.
 */
public class MessageTypeAdapter extends TypeAdapter<Message> {

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.ThrowableTypeAdapter.java

/**
 * A type adapter for {@link Throwable}. This is used to report issues to the sender of a request.
 */
public class ThrowableTypeAdapter extends TypeAdapter<Throwable> {

    public static class Factory implements TypeAdapterFactory {

From source file org.eclipse.packagedrone.repo.adapter.maven.ByteArrayAdapter.java

public class ByteArrayAdapter extends TypeAdapter<byte[]> {

    @Override
    public byte[] read(final JsonReader reader) throws IOException {
        if (reader.peek() == JsonToken.NULL) {
            reader.nextNull();

From source file org.eclipse.packagedrone.repo.gson.MetaKeyTypeAdapter.java

public class MetaKeyTypeAdapter extends TypeAdapter<MetaKey> {

    public static final MetaKeyTypeAdapter INSTANCE = new MetaKeyTypeAdapter();

    /**
     * @deprecated Use the field {@link #INSTANCE} instead

From source file org.eclipse.recommenders.internal.coordinates.rcp.ProjectCoordinateJsonTypeAdapter.java

/**
 * {@link TypeAdapter} implementation for {@link ProjectCoordinate}. To serialize a ProjectCoordinate the method
 * {@code ProjectCoordinate.toString()} is used. For the deserialization {@code ProjectCoordinate.valueof(String)} is
 * used.
 * <p>
 * The json representation looks like: jre:jre:1.6.0

From source file org.eclipse.recommenders.utils.gson.FieldNameTypeAdapter.java

public class FieldNameTypeAdapter extends TypeAdapter<IFieldName> {

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