去除项目对hutool.jsonutil的依赖
This commit is contained in:
parent
d11f8bf016
commit
c1785f297c
|
@ -15,14 +15,14 @@
|
|||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-json</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,6 +1,6 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class AndELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public AndELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class AndELWrapper extends ELWrapper{
|
|||
public AndELWrapper data(String dataName, String jsonString) {
|
||||
// 校验字符串符合Json格式
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class AndELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public AndELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class CatchELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public CatchELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class CatchELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public CatchELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class CatchELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public CatchELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class FinallyELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public FinallyELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class FinallyELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public FinallyELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class FinallyELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public FinallyELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class ForELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public ForELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class ForELWrapper extends LoopELWrapper{
|
|||
@Override
|
||||
public ForELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class ForELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public ForELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -220,7 +220,7 @@ public class IfELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public IfELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class IfELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public IfELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ public class IfELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public IfELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class IteratorELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public IteratorELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class IteratorELWrapper extends LoopELWrapper{
|
|||
@Override
|
||||
public IteratorELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class IteratorELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public IteratorELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public abstract class LoopELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public LoopELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public abstract class LoopELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public LoopELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public abstract class LoopELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public LoopELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class NodeELWrapper extends ELWrapper {
|
|||
|
||||
@Override
|
||||
public NodeELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class NodeELWrapper extends ELWrapper {
|
|||
@Override
|
||||
public NodeELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class NodeELWrapper extends ELWrapper {
|
|||
|
||||
@Override
|
||||
public NodeELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class NotELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public NotELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class NotELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public NotELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class NotELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public NotELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class OrELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public OrELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class OrELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public OrELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class OrELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public OrELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class PreELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public PreELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class PreELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public PreELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class PreELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public PreELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class SwitchELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public SwitchELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class SwitchELWrapper extends ELWrapper{
|
|||
@Override
|
||||
public SwitchELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class SwitchELWrapper extends ELWrapper{
|
|||
|
||||
@Override
|
||||
public SwitchELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -78,7 +78,7 @@ public class ThenELWrapper extends ELWrapper {
|
|||
// data关键字的约束:允许以Bean、jsonString、map类型输入数据,必须包含dataName参数。
|
||||
@Override
|
||||
public ThenELWrapper data(String dataName, Object javaBean) {
|
||||
setData(JSONUtil.toJsonStr(javaBean));
|
||||
setData(JsonUtil.toJsonString(javaBean));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class ThenELWrapper extends ELWrapper {
|
|||
@Override
|
||||
public ThenELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class ThenELWrapper extends ELWrapper {
|
|||
|
||||
@Override
|
||||
public ThenELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.yomahub.liteflow.builder.el;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class WhenELWrapper extends ELWrapper {
|
|||
|
||||
@Override
|
||||
public WhenELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ public class WhenELWrapper extends ELWrapper {
|
|||
@Override
|
||||
public WhenELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ public class WhenELWrapper extends ELWrapper {
|
|||
|
||||
@Override
|
||||
public WhenELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.yomahub.liteflow.builder.el;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class WhileELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public WhileELWrapper data(String dataName, Object object) {
|
||||
setData(JSONUtil.toJsonStr(object));
|
||||
setData(JsonUtil.toJsonString(object));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class WhileELWrapper extends LoopELWrapper{
|
|||
@Override
|
||||
public WhileELWrapper data(String dataName, String jsonString) {
|
||||
try {
|
||||
JSONUtil.parseObj(jsonString);
|
||||
JsonUtil.parseObject(jsonString);
|
||||
} catch (Exception e){
|
||||
throw new RuntimeException("字符串不符合Json格式!");
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class WhileELWrapper extends LoopELWrapper{
|
|||
|
||||
@Override
|
||||
public WhileELWrapper data(String dataName, Map<String, Object> jsonMap) {
|
||||
setData(JSONUtil.toJsonStr(jsonMap));
|
||||
setData(JsonUtil.toJsonString(jsonMap));
|
||||
setDataName(dataName);
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.yomahub.liteflow.test.builder;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.builder.el.ELBus;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
@ -111,7 +111,7 @@ public class ThenELBuilderTest extends BaseTest {
|
|||
Map<String, Object> name2Value = new HashMap<String, Object>();
|
||||
name2Value.put("name", "zhangsan");
|
||||
name2Value.put("age", 18);
|
||||
System.out.println(JSONUtil.toJsonStr(name2Value));
|
||||
System.out.println(JsonUtil.toJsonString(name2Value));
|
||||
Assertions.assertEquals(ELBus.then("a", ELBus.then("b").then("c").id("this is a id")).tag("this is a tag").then("d").data("thenData", name2Value).pre("p").finallyOpt("f").toEL(),
|
||||
"thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\").data(thenData)");
|
||||
System.out.println("thenData = '{\"name\":\"zhangsan\",\"age\":18}';\nTHEN(PRE(node(\"p\")),node(\"a\"),THEN(node(\"b\"),node(\"c\")).id(\"this is a id\"),node(\"d\"),FINALLY(node(\"f\"))).tag(\"this is a tag\").data(thenData)");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.yomahub.liteflow.test.builder;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.yomahub.liteflow.builder.el.ELBus;
|
||||
import com.yomahub.liteflow.test.BaseTest;
|
||||
import com.yomahub.liteflow.util.JsonUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
@ -118,7 +118,7 @@ public class WhenELBuilderTest extends BaseTest {
|
|||
Map<String, Object> name2Value = new HashMap<String, Object>();
|
||||
name2Value.put("name", "zhangsan");
|
||||
name2Value.put("age", 18);
|
||||
System.out.println(JSONUtil.toJsonStr(name2Value));
|
||||
System.out.println(JsonUtil.toJsonString(name2Value));
|
||||
String actualStr = "whenData = '{\"name\":\"zhangsan\",\"age\":18}';\nWHEN(node(\"a\"),WHEN(node(\"b\"),node(\"c\")).id(\"this is a id\").data(whenData),node(\"d\")).tag(\"this is a tag\")";
|
||||
Assertions.assertEquals(ELBus.when("a", ELBus.when("b").when("c").data("whenData", name2Value).id("this is a id")).when("d").tag("this is a tag").toEL(false),
|
||||
actualStr);
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -53,7 +53,6 @@
|
|||
<curator.version>5.3.0</curator.version>
|
||||
<junit.version>5.8.2</junit.version>
|
||||
<hutool-core.version>5.8.11</hutool-core.version>
|
||||
<hutool-json.version>5.8.11</hutool-json.version>
|
||||
<transmittable-thread-local.version>2.12.3</transmittable-thread-local.version>
|
||||
<curator-test.version>5.1.0</curator-test.version>
|
||||
<zkclient.version>0.10</zkclient.version>
|
||||
|
@ -176,11 +175,6 @@
|
|||
<artifactId>hutool-core</artifactId>
|
||||
<version>${hutool-core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-json</artifactId>
|
||||
<version>${hutool-json.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>transmittable-thread-local</artifactId>
|
||||
|
|
Loading…
Reference in New Issue