Commit 76824080 by s_guodong

注释defaultRule执行的方法

parent cb79c2a7
......@@ -15,7 +15,7 @@ public class Argument<E> implements IResult {
}
public Argument(String fieldName) {
this.fieldName = "trim(" + fieldName + ")";
this.fieldName = fieldName;
}
public Argument(String fieldName, OpType opType, E value) {
......@@ -29,7 +29,7 @@ public class Argument<E> implements IResult {
}
public Argument(String fieldName, OpType opType) {
this.fieldName = "trim(" + fieldName + ")";
this.fieldName = fieldName;
this.opType = opType;
this.value = null;
}
......
......@@ -4,8 +4,6 @@ import com.brilliance.mda.runtime.mda.*;
import com.brilliance.mda.runtime.mda.driver.DCR;
import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv;
import com.brilliance.mda.runtime.mda.driver.compile.component.AbstractAutoCompileEmitter;
import com.brilliance.mda.runtime.mda.driver.compile.component.AbstractAutoCompileScopeEmitter;
import com.brilliance.mda.runtime.mda.impl.AbstractScopeEmitter;
import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.ModuleList;
......@@ -100,49 +98,49 @@ public class Modules {
//ExecuteDefault
public static void postDefaultRule(IModule module, String field) {
if (field != null) {
if (module.getParent() instanceof IModuleList) {
//modulelist的儿子模型
AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) module.getParent()).getDataClass());
scopeEmitter.acceptContext(module);
if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(field);
} else {
scopeEmitter.executeDefault(field);
}
scopeEmitter.removeContext();
} else {
String fieldPath = module.getFieldPath(field);
int leftCommas = fieldPath.indexOf('(');
if (leftCommas > -1) {
//modulelist的孙子模型
int rightCommas = fieldPath.indexOf(leftCommas, ')');
String relativePath = fieldPath.substring(rightCommas + 1);
//String moduleListPath = fieldPath.substring(0, leftCommas);
IModule parent = module.getParent();
IModule scopeModule = module;
while (parent != null && !(parent instanceof IModuleList)) {
scopeModule = parent;
parent = parent.getParent();
}
AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) parent).getDataClass());
scopeEmitter.acceptContext(scopeModule);
if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(relativePath);
} else {
scopeEmitter.executeDefault(relativePath);
}
scopeEmitter.removeContext();
} else {
if (MdaEnv.getContext().getEmitter() instanceof AbstractAutoCompileEmitter) {
((AbstractAutoCompileEmitter) MdaEnv.getContext().getEmitter()).executePostDefault(fieldPath);
} else {
MdaEnv.getContext().getEmitter().executeDefault(fieldPath);
}
}
}
} else
MdaEnv.getContext().getEmitter().executeDefault(module.getPath());
// if (field != null) {
// if (module.getParent() instanceof IModuleList) {
// //modulelist的儿子模型
// AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) module.getParent()).getDataClass());
// scopeEmitter.acceptContext(module);
// if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
// ((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(field);
// } else {
// scopeEmitter.executeDefault(field);
// }
// scopeEmitter.removeContext();
// } else {
// String fieldPath = module.getFieldPath(field);
// int leftCommas = fieldPath.indexOf('(');
// if (leftCommas > -1) {
// //modulelist的孙子模型
// int rightCommas = fieldPath.indexOf(leftCommas, ')');
// String relativePath = fieldPath.substring(rightCommas + 1);
// //String moduleListPath = fieldPath.substring(0, leftCommas);
// IModule parent = module.getParent();
// IModule scopeModule = module;
// while (parent != null && !(parent instanceof IModuleList)) {
// scopeModule = parent;
// parent = parent.getParent();
// }
// AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) parent).getDataClass());
// scopeEmitter.acceptContext(scopeModule);
// if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
// ((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(relativePath);
// } else {
// scopeEmitter.executeDefault(relativePath);
// }
// scopeEmitter.removeContext();
// } else {
// if (MdaEnv.getContext().getEmitter() instanceof AbstractAutoCompileEmitter) {
// ((AbstractAutoCompileEmitter) MdaEnv.getContext().getEmitter()).executePostDefault(fieldPath);
// } else {
// MdaEnv.getContext().getEmitter().executeDefault(fieldPath);
// }
// }
// }
// } else
// MdaEnv.getContext().getEmitter().executeDefault(module.getPath());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment