All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.jackson.module.jsonorg.JsonOrgModule Maven / Gradle / Ivy

Go to download

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy