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 com.google.gerrit.server.events.SupplierDeserializer.java

public class SupplierDeserializer implements JsonDeserializer<Supplier<?>> {

    @Override
    public Supplier<?> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        checkArgument(typeOfT instanceof ParameterizedType);

From source file com.google.gwtjsonrpc.server.CallDeserializer.java

final class CallDeserializer<CallType extends ActiveCall>
        implements JsonDeserializer<CallType>, InstanceCreator<CallType> {
    private final CallType req;
    private final JsonServlet<? extends ActiveCall> server;

    CallDeserializer(final CallType call, final JsonServlet<CallType> jsonServlet) {

From source file com.google.gwtjsonrpc.server.MapDeserializer.java

public class MapDeserializer implements JsonDeserializer<Map<Object, Object>>, JsonSerializer<Map<Object, Object>>,
        InstanceCreator<Map<Object, Object>> {
    public Map<Object, Object> createInstance(final Type type) {
        return new HashMap<Object, Object>();
    }

From source file com.google.gwtjsonrpc.server.SqlDateDeserializer.java

public class SqlDateDeserializer implements JsonDeserializer<java.sql.Date>, JsonSerializer<java.sql.Date> {
    public java.sql.Date deserialize(final JsonElement json, final Type typeOfT,
            final JsonDeserializationContext context) throws JsonParseException {
        if (json.isJsonNull()) {
            return null;
        }

From source file com.google.gwtjsonrpc.server.SqlTimestampDeserializer.java

public class SqlTimestampDeserializer
        implements JsonDeserializer<java.sql.Timestamp>, JsonSerializer<java.sql.Timestamp> {
    private static final TimeZone UTC = TimeZone.getTimeZone("UTC");

    public java.sql.Timestamp deserialize(final JsonElement json, final Type typeOfT,
            final JsonDeserializationContext context) throws JsonParseException {

From source file com.google.mr4c.serialize.json.DocumentSerializer.java

/*package*/ class DocumentSerializer implements JsonSerializer<Document>, JsonDeserializer<Document> {
    public Document deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        return new Document(json);
    }

From source file com.google.mr4c.serialize.json.MetadataEntryBeanDeserializer.java

/*package*/ class MetadataEntryBeanDeserializer implements JsonDeserializer<MetadataEntryBean> {

    public MetadataEntryBean deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {
        MetadataElementType elementType = MetadataElementType
                .valueOf(json.getAsJsonObject().getAsJsonPrimitive("elementType").getAsString());

From source file com.google.nigori.common.TypeAdapterByteString.java

public class TypeAdapterByteString implements JsonSerializer<ByteString>, JsonDeserializer<ByteString> {

    @Override
    public JsonElement serialize(ByteString src, Type typeOfSrc, JsonSerializationContext context) {
        return context.serialize(new String(Base64.encodeBase64(src.toByteArray())));
    }

From source file com.google.nigori.common.TypeAdapterProtobuf.java

/**
 * Gson type adapter for protocol buffers
 *
 * @author Inderjeet Singh
 */
public class TypeAdapterProtobuf implements JsonSerializer<GeneratedMessage>, JsonDeserializer<GeneratedMessage> {

From source file com.google.wave.api.impl.ElementGsonAdaptor.java

/**
 * Gson adaptor to serialize and deserialize {@link Element}.
 *
 * @author mprasetya@google.com (Marcel Prasetya)
 */
public class ElementGsonAdaptor implements JsonDeserializer<Element>, JsonSerializer<Element> {