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

cn.sexycode.springo.bo.instance.impl.JsonTransformImpl Maven / Gradle / Ivy

The newest version!
package cn.sexycode.springo.bo.instance.impl;

import cn.sexycode.springo.bo.instance.BoUtil;
import cn.sexycode.springo.bo.instance.DataTransform;
import cn.sexycode.springo.bo.model.BoData;
import cn.sexycode.springo.core.base.core.json.JSONObject;
import org.springframework.stereotype.Component;

/**
 * @author qzz
 */
@Component
public class JsonTransformImpl implements DataTransform {

    @Override
    public BoData parse(String data) {
        JSONObject json = JSONObject.parseObject(data);
        return BoUtil.transJSON(json);
    }

    @Override
    public String getByData(BoData boData, boolean needInitData) {
        JSONObject json = BoUtil.toJSONObject(boData, needInitData);
        return json.toJSONString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy