@@ -0,0 +1,3646 @@
+package com.github.donmahallem.cs.kvf.gson;%0A%0Aimport com.google.gson.JsonParseException;%0Aimport com.google.gson.TypeAdapter;%0Aimport com.google.gson.stream.JsonReader;%0Aimport com.google.gson.stream.JsonToken;%0Aimport com.google.gson.stream.JsonWriter;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Created by windo on 25.08.2016.%0A */%0Apublic class DataObjectConverter extends TypeAdapter%3CDataObject%3E %7B%0A%0A    private final boolean mNumberConversion;%0A%0A    public DataObjectConverter() %7B%0A        this(false);%0A    %7D%0A%0A    public DataObjectConverter(boolean numberConversion) %7B%0A        this.mNumberConversion = numberConversion;%0A    %7D%0A%0A    @Override%0A    public void write(JsonWriter jsonWriter, DataObject dataObject) throws IOException %7B%0A        if (dataObject == null) %7B%0A            jsonWriter.nullValue();%0A            return;%0A        %7D%0A        jsonWriter.beginObject();%0A        Object value = null;%0A        for (String name : dataObject.mData.keySet()) %7B%0A            jsonWriter.name(name);%0A            value = dataObject.get(name);%0A            if (value == null) %7B%0A                jsonWriter.nullValue();%0A            %7D else if (value instanceof DataObject) %7B%0A                write(jsonWriter, (DataObject) value);%0A            %7D else if (value instanceof Float) %7B%0A                jsonWriter.value((Float) value);%0A            %7D else if (value instanceof Integer) %7B%0A                jsonWriter.value((Integer) value);%0A            %7D else if (value instanceof String) %7B%0A                jsonWriter.value((String) value);%0A            %7D else %7B%0A                throw new JsonParseException(%22Unknown type%22);%0A            %7D%0A        %7D%0A        jsonWriter.endObject();%0A    %7D%0A%0A    @Override%0A    public DataObject read(JsonReader jsonReader) throws IOException %7B%0A        if (jsonReader.peek() != JsonToken.BEGIN_OBJECT) %7B%0A            throw new JsonParseException(%22expected object%22);%0A        %7D%0A        DataObject dataObject = new DataObject();%0A        jsonReader.beginObject();%0A        String name = null;%0A        String value = null;%0A        while (jsonReader.hasNext()) %7B%0A            name = jsonReader.nextName();%0A            switch (jsonReader.peek()) %7B%0A                case BEGIN_OBJECT:%0A                    if (dataObject.mData.containsKey(name)) %7B%0A                        if (dataObject.mData.get(name) instanceof DataObject) %7B%0A                            ((DataObject) dataObject.mData.get(name)).mData.putAll(this.read(jsonReader).mData);%0A                        %7D else %7B%0A                            throw new JsonParseException(%22original '%22 + name + %22' is not of type DataObject%22);%0A                        %7D%0A                    %7D else %7B%0A                        dataObject.mData.put(name, this.read(jsonReader));%0A                    %7D%0A                    break;%0A                case STRING:%0A                    value = jsonReader.nextString();%0A                    if (this.mNumberConversion) %7B%0A                        if (value.matches(%22%5B0-9%5D*%22)) %7B%0A                            dataObject.mData.put(name, Integer.parseInt(value));%0A                        %7D else if (value.matches(%22%5B0-9%5D*%5C%5C.%5B0-9%5D*%22)) %7B%0A                            dataObject.mData.put(name, Float.parseFloat(value));%0A                        %7D else %7B%0A                            dataObject.mData.put(name, value);%0A                        %7D%0A                    %7D else%0A                        dataObject.mData.put(name, value);%0A                    break;%0A                default:%0A                    System.out.println(%22Miss: %22 + jsonReader.peek());%0A                    jsonReader.skipValue();%0A                    break;%0A            %7D%0A        %7D%0A        jsonReader.endObject();%0A        return dataObject;%0A    %7D%0A%7D%0A

Create DataObjectConverter.java