gu.sql2java.excel.json.FastjsonDeserializeHandler Maven / Gradle / Ivy
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