net.ibizsys.model.util.merger.wf.PSWFLinkCondListMerger Maven / Gradle / Ivy
package net.ibizsys.model.util.merger.wf;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import net.ibizsys.model.util.merger.IPSModelListMerger;
import net.ibizsys.model.util.merger.IPSModelMergeContext;
import net.ibizsys.model.util.merger.IPSModelMerger;
import net.ibizsys.model.util.merger.PSModelMergerFactory;
public class PSWFLinkCondListMerger extends net.ibizsys.model.util.merger.PSModelListMergerBase{
@Override
protected String getTagField(IPSModelMergeContext iPSModelMergeContext) {
return iPSModelMergeContext.getPSModelTagField(net.ibizsys.model.wf.IPSWFLinkCond.class);
}
@Override
protected boolean isAppendChildOnly(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isAppendChildOnly(net.ibizsys.model.wf.IPSWFLinkCond.class);
return (ret != null)?ret:super.isAppendChildOnly(iPSModelMergeContext);
}
@Override
protected boolean isEnableMergeChild(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isEnableMergeChild(net.ibizsys.model.wf.IPSWFLinkCond.class);
return (ret != null)?ret:super.isEnableMergeChild(iPSModelMergeContext);
}
@Override
protected boolean isEnableMergeSingle(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isEnableMergeSingle(net.ibizsys.model.wf.IPSWFLinkCond.class);
return (ret != null)?ret:super.isEnableMergeSingle(iPSModelMergeContext);
}
@Override
protected IPSModelMerger getPSModelMerger(IPSModelMergeContext iPSModelMergeContext, ObjectNode objectNode) throws Exception {
JsonNode typeJsonNode = objectNode.get("condType");
String strTypeValue = (typeJsonNode == null)?"":typeJsonNode.asText("");
switch(strTypeValue){
case "GROUP":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFLinkGroupCondImpl.class, false);
case "SINGLE":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFLinkSingleCondImpl.class, false);
default:
throw new Exception("未提供默认模型合并器");
}
}
}