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

info.hexin.json.parser.JsonParserConfig Maven / Gradle / Ivy

package info.hexin.json.parser;

import info.hexin.json.parser.impl.ArrayParser;
import info.hexin.json.parser.impl.MapParser;
import info.hexin.json.parser.impl.StringParser;

import java.util.HashMap;
import java.util.Map;

/**
 * 配置反序列化
 * 
 * @author hexin
 * 
 */
public class JsonParserConfig {
    private static final char MapStart = '{';
    private static final char ListStart = '[';
    private static final char String1 = '"';
    private static final char String2 = '\'';
    private static Map jsonRenderMap = new HashMap();
    static {
        jsonRenderMap.put(MapStart, MapParser.instance);
        jsonRenderMap.put(ListStart, ArrayParser.instance);
        jsonRenderMap.put(String1, StringParser.instance);
        jsonRenderMap.put(String2, StringParser.instance);
    }

    public static JsonParser getParser(Character character) {
        return jsonRenderMap.get(character);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy