Skip to content

Instantly share code, notes, and snippets.

@anirudhramanan
anirudhramanan / Madman.md
Last active Mar 31, 2020
Madman integration steps
View Madman.md

Madman Integration

If you need to integrate directly with the madman library, follow the below steps

1. Get Madman

Add the jitpack dependency in your root build.gradle

allprojects {
View JsonArrayTypeAdapter.java
/**
* Type Adapter for {@link JsonArray}
*/
public static final class JsonArrayTypeAdapter extends TypeAdapter<JsonArray> {
@Override
public void write(JsonWriter out, JsonArray value) throws IOException {
JsonElementTypeAdapter.writeJsonElement(out, value);
}
View JsonObjectTypeAdapter.java
/**
* Type Adapter for {@link JsonObject}
*/
public static final class JsonObjectTypeAdapter extends TypeAdapter<JsonObject> {
@Override
public void write(JsonWriter out, JsonObject value) throws IOException {
JsonElementTypeAdapter.writeJsonElement(out, value);
}
@anirudhramanan
anirudhramanan / grep_internal_links.py
Created Dec 15, 2016
Script to grep all the internal links for a given url.
View grep_internal_links.py
View KnownTypeAdapters.java
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSyntaxException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.JsonReaderInternalAccess;
import com.google.gson.internal.LinkedTreeMap;