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.alessandro.jpocket.gson.StatusesDeserializer.java

public class StatusesDeserializer implements JsonDeserializer<Statuses> {

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

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

public class DurationConverter implements JsonSerializer<Duration>, JsonDeserializer<Duration> {

    @Override
    public JsonElement serialize(Duration duration, Type typeOfSrc, JsonSerializationContext context) {
        LocalTime plus = LocalTime.MIDNIGHT.plus(duration);
        String middle = plus.format(DateTimeFormatter.ofPattern("HH:mm:ss"));

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

public class EnumDeSerializer<T extends Enum<T>> implements JsonSerializer<T>, JsonDeserializer<T> {

    private T[] values;

    private EnumDeSerializer(T[] values) {
        this.values = values;

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

public class GsonNameDeserializer implements JsonDeserializer<IName>, JsonSerializer<IName> {

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

From source file cc.kave.commons.utils.json.legacy.GsonFieldNameDeserializer.java

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

From source file cc.kave.commons.utils.json.legacy.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.kave.commons.utils.json.legacy.GsonMethodNameDeserializer.java

public class GsonMethodNameDeserializer implements JsonDeserializer<ICoReMethodName> {

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

From source file cc.kave.commons.utils.json.legacy.GsonTypeNameDeserializer.java

public class GsonTypeNameDeserializer implements JsonDeserializer<ICoReTypeName> {

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

From source file cc.kave.commons.utils.json.legacy.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.kave.commons.utils.json.legacy.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));