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

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

Introduction

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

Usage

From source file cc.kave.commons.utils.json.LocalDateTimeConverter.java

public class LocalDateTimeConverter implements JsonSerializer<LocalDateTime>, JsonDeserializer<LocalDateTime> {

    @Override
    public JsonElement serialize(LocalDateTime src, Type typeOfSrc, JsonSerializationContext context) {
        return new JsonPrimitive(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(src));
    }

From source file cc.recommenders.utils.gson.GsonFieldNameDeserializer.java

public class GsonFieldNameDeserializer implements JsonDeserializer<IFieldName> {
    @Override
    public IFieldName deserialize(final JsonElement json, final Type typeOfT,
            final JsonDeserializationContext context) throws JsonParseException {
        final String identifier = json.getAsString();
        return VmFieldName.get(identifier);

From source file cc.recommenders.utils.gson.GsonFileDeserializer.java

public class GsonFileDeserializer implements JsonDeserializer<File> {

    @Override
    public File deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context)
            throws JsonParseException {
        final String path = json.getAsString();

From source file cc.recommenders.utils.gson.GsonMethodNameDeserializer.java

public class GsonMethodNameDeserializer implements JsonDeserializer<IMethodName> {

    @Override
    public IMethodName deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        String identifier = json.getAsString();

From source file cc.recommenders.utils.gson.GsonTypeNameDeserializer.java

public class GsonTypeNameDeserializer implements JsonDeserializer<ITypeName> {

    @Override
    public ITypeName deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        String identifier = json.getAsString();

From source file cc.recommenders.utils.gson.ISO8601DateParser.java

public class ISO8601DateParser implements JsonDeserializer<Date>, JsonSerializer<Date> {

    @Override
    public Date deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context)
            throws JsonParseException {

From source file cc.recommenders.utils.gson.MultimapTypeAdapter.java

@SuppressWarnings({ "rawtypes", "unchecked" })
public class MultimapTypeAdapter implements JsonSerializer<Multimap>, JsonDeserializer<Multimap> {

    @Override
    public JsonElement serialize(final Multimap src, final Type typeOfSrc, final JsonSerializationContext context) {
        return context.serialize(src.asMap(), createMapType(typeOfSrc));

From source file ch.ethz.inf.vs.hypermedia.corehal.FormListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class FormListDeserializer implements JsonDeserializer<FormList>, JsonSerializer<FormList> {
    @Override
    public FormList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)

From source file ch.ethz.inf.vs.hypermedia.corehal.LinkListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class LinkListDeserializer implements JsonDeserializer<LinkList>, JsonSerializer<LinkList> {
    @Override
    public LinkList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)

From source file ch.ethz.inf.vs.hypermedia.corehal.OptionalListDeserializer.java

/**
 * Created by ynh on 26/11/15.
 */
public class OptionalListDeserializer implements JsonDeserializer<OptionalList>, JsonSerializer<OptionalList> {
    public static JsonElement cleanup(JsonElement serialize) {
        if (serialize.isJsonObject()) {