com.fasterxml.jackson.module.jsonorg.JsonOrgModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-module-json-org Show documentation
Show all versions of jackson-module-json-org Show documentation
Support for datatypes of "org.json" JSON library (see http://json.org/java),
mainly to make it easier to upgrade code to Jackson, using automated conversions.
The newest version!
package com.fasterxml.jackson.module.jsonorg;
import org.codehaus.jackson.Version;
import org.codehaus.jackson.map.module.SimpleModule;
import org.json.JSONArray;
import org.json.JSONObject;
public class JsonOrgModule extends SimpleModule
{
private final static String NAME = "JsonOrgModule";
// Should externalize this somehow
private final static Version VERSION = new Version(0, 9, 0, null);
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public JsonOrgModule()
{
super(NAME, VERSION);
addDeserializer(JSONArray.class, JSONArrayDeserializer.instance);
addDeserializer(JSONObject.class, JSONObjectDeserializer.instance);
addSerializer(JSONArraySerializer.instance);
addSerializer(JSONObjectSerializer.instance);
}
}