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

com.github.ltsopensource.core.json.JSONAdapter Maven / Gradle / Ivy

package com.github.ltsopensource.core.json;

import com.github.ltsopensource.core.constant.ExtConfig;
import com.github.ltsopensource.core.spi.SPI;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

/**
 * @author Robert HG ([email protected]) on 11/19/15.
 */
@SPI(key = ExtConfig.LTS_JSON, dftValue = "fastjson")
public interface JSONAdapter {

    public String getName();

    public  T parse(String json, Type type);

    public String toJSONString(Object obj);

    public JSONObject toJSONObject(Object obj);

    public JSONArray toJSONArray(Object obj);

    public JSONArray parseArray(String json);

    public JSONObject parseObject(String json);

    public JSONObject newJSONObject();

    public JSONObject newJSONObject(Map map);

    public JSONObject newJSONObject(int initialCapacity);

    public JSONArray newJSONArray();

    public JSONArray newJSONArray(List list);

    public JSONArray newJSONArray(int initialCapacity);

}