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

cn.schoolwow.util.module.query.resource.flow.JSONObjectToInstanceFlow Maven / Gradle / Ivy

The newest version!
package cn.schoolwow.util.module.query.resource.flow;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import com.alibaba.fastjson.JSONObject;

public class JSONObjectToInstanceFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        JSONObject jsonObject = (JSONObject) flowContext.checkData("jsonObject");
        Class clazz = (Class) flowContext.checkData("clazz");

        T instance = jsonObject.toJavaObject(clazz);
        flowContext.putReturnData("instance", instance);
    }

    @Override
    public String name() {
        return "JSONObject对象转换为实例";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy