net.ibizsys.model.util.merger.control.PSEditorMerger Maven / Gradle / Ivy
package net.ibizsys.model.util.merger.control;
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.PSModelMergerFactory;
import static net.ibizsys.model.control.PSEditorImpl.*;
public class PSEditorMerger extends net.ibizsys.model.util.merger.PSModelMergerBase{
@Override
protected boolean isEnableMergeChild(IPSModelMergeContext iPSModelMergeContext, String strFieldName) {
Boolean ret = iPSModelMergeContext.isEnableMergeChild(net.ibizsys.model.control.PSEditorImpl.class, strFieldName);
return (ret != null)?ret:super.isEnableMergeChild(iPSModelMergeContext, strFieldName);
}
@Override
protected void onMerge(IPSModelMergeContext iPSModelMergeContext, ObjectNode objectNode, ObjectNode mergeObjectNode) throws Exception {
if(isEnableMergeChild(iPSModelMergeContext, ATTR_GETPSEDITORITEMS)){
IPSModelListMerger iPSModelListMerger = iPSModelMergeContext.getPSModelListMerger(net.ibizsys.model.control.IPSEditorItem.class, true);
if(iPSModelListMerger != null){
iPSModelListMerger.merge(iPSModelMergeContext, objectNode, mergeObjectNode, ATTR_GETPSEDITORITEMS);
}
}
if(isEnableMergeChild(iPSModelMergeContext, ATTR_GETPSNAVIGATECONTEXTS)){
IPSModelListMerger iPSModelListMerger = iPSModelMergeContext.getPSModelListMerger(net.ibizsys.model.control.IPSNavigateContext.class, true);
if(iPSModelListMerger != null){
iPSModelListMerger.merge(iPSModelMergeContext, objectNode, mergeObjectNode, ATTR_GETPSNAVIGATECONTEXTS);
}
}
if(isEnableMergeChild(iPSModelMergeContext, ATTR_GETPSNAVIGATEPARAMS)){
IPSModelListMerger iPSModelListMerger = iPSModelMergeContext.getPSModelListMerger(net.ibizsys.model.control.IPSNavigateParam.class, true);
if(iPSModelListMerger != null){
iPSModelListMerger.merge(iPSModelMergeContext, objectNode, mergeObjectNode, ATTR_GETPSNAVIGATEPARAMS);
}
}
if(isEnableMergeChild(iPSModelMergeContext, ATTR_GETPSSYSDICTCAT)){
IPSModelListMerger iPSModelListMerger = iPSModelMergeContext.getPSModelListMerger(net.ibizsys.model.res.IPSSysDictCat.class, true);
if(iPSModelListMerger != null){
iPSModelListMerger.mergeSingle(iPSModelMergeContext, objectNode, mergeObjectNode, ATTR_GETPSSYSDICTCAT);
}
}
super.onMerge(iPSModelMergeContext, objectNode, mergeObjectNode);
}
}