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

gu.sql2java.excel.json.FastjsonDeserializeHandler Maven / Gradle / Ivy

There is a newer version: 5.3.2
Show newest version
package gu.sql2java.excel.json;

import com.alibaba.fastjson.parser.DefaultJSONParser;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.parser.deserializer.ObjectDeserializer;

/**
 * JSON类型字段使用FASTJSON自定义反序列化器实现的数据导入适配器实现
 * @author guyadong
 * @since 3.29.0
 */
@SuppressWarnings("rawtypes")
public class FastjsonDeserializeHandler extends BaseJsonDeserializeHandler {
	public FastjsonDeserializeHandler() {
		super();
	}
	public FastjsonDeserializeHandler(ObjectDeserializer initDeserializer, Class initType, T initEmptyValue) {
		super(initDeserializer, initType, initEmptyValue);
	}
	protected Object deserialize(String value,ObjectDeserializer deserializer,Class type) {
		ParserConfig mapping = new ParserConfig();
        DefaultJSONParser parser = new DefaultJSONParser(value, mapping);
        return deserializer.deserialze(parser, type, null);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy