Commit 76824080 by s_guodong

注释defaultRule执行的方法

parent cb79c2a7
...@@ -15,7 +15,7 @@ public class Argument<E> implements IResult { ...@@ -15,7 +15,7 @@ public class Argument<E> implements IResult {
} }
public Argument(String fieldName) { public Argument(String fieldName) {
this.fieldName = "trim(" + fieldName + ")"; this.fieldName = fieldName;
} }
public Argument(String fieldName, OpType opType, E value) { public Argument(String fieldName, OpType opType, E value) {
...@@ -29,7 +29,7 @@ public class Argument<E> implements IResult { ...@@ -29,7 +29,7 @@ public class Argument<E> implements IResult {
} }
public Argument(String fieldName, OpType opType) { public Argument(String fieldName, OpType opType) {
this.fieldName = "trim(" + fieldName + ")"; this.fieldName = fieldName;
this.opType = opType; this.opType = opType;
this.value = null; this.value = null;
} }
......
...@@ -4,8 +4,6 @@ import com.brilliance.mda.runtime.mda.*; ...@@ -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.DCR;
import com.brilliance.mda.runtime.mda.driver.MdaDriver; import com.brilliance.mda.runtime.mda.driver.MdaDriver;
import com.brilliance.mda.runtime.mda.driver.MdaEnv; 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.AbstractScopeEmitter;
import com.brilliance.mda.runtime.mda.impl.Argument; import com.brilliance.mda.runtime.mda.impl.Argument;
import com.brilliance.mda.runtime.mda.impl.ModuleList; import com.brilliance.mda.runtime.mda.impl.ModuleList;
...@@ -100,49 +98,49 @@ public class Modules { ...@@ -100,49 +98,49 @@ public class Modules {
//ExecuteDefault //ExecuteDefault
public static void postDefaultRule(IModule module, String field) { public static void postDefaultRule(IModule module, String field) {
if (field != null) { // if (field != null) {
if (module.getParent() instanceof IModuleList) { // if (module.getParent() instanceof IModuleList) {
//modulelist的儿子模型 // //modulelist的儿子模型
AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) module.getParent()).getDataClass()); // AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) module.getParent()).getDataClass());
scopeEmitter.acceptContext(module); // scopeEmitter.acceptContext(module);
if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) { // if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(field); // ((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(field);
} else { // } else {
scopeEmitter.executeDefault(field); // scopeEmitter.executeDefault(field);
} // }
scopeEmitter.removeContext(); // scopeEmitter.removeContext();
} else { // } else {
String fieldPath = module.getFieldPath(field); // String fieldPath = module.getFieldPath(field);
int leftCommas = fieldPath.indexOf('('); // int leftCommas = fieldPath.indexOf('(');
if (leftCommas > -1) { // if (leftCommas > -1) {
//modulelist的孙子模型 // //modulelist的孙子模型
int rightCommas = fieldPath.indexOf(leftCommas, ')'); // int rightCommas = fieldPath.indexOf(leftCommas, ')');
String relativePath = fieldPath.substring(rightCommas + 1); // String relativePath = fieldPath.substring(rightCommas + 1);
//String moduleListPath = fieldPath.substring(0, leftCommas); // //String moduleListPath = fieldPath.substring(0, leftCommas);
IModule parent = module.getParent(); // IModule parent = module.getParent();
IModule scopeModule = module; // IModule scopeModule = module;
while (parent != null && !(parent instanceof IModuleList)) { // while (parent != null && !(parent instanceof IModuleList)) {
scopeModule = parent; // scopeModule = parent;
parent = parent.getParent(); // parent = parent.getParent();
} // }
AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) parent).getDataClass()); // AbstractScopeEmitter scopeEmitter = DCR.getModuleListEmitter(((IModuleList) parent).getDataClass());
scopeEmitter.acceptContext(scopeModule); // scopeEmitter.acceptContext(scopeModule);
if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) { // if (scopeEmitter instanceof AbstractAutoCompileScopeEmitter) {
((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(relativePath); // ((AbstractAutoCompileScopeEmitter) scopeEmitter).executePostDefault(relativePath);
} else { // } else {
scopeEmitter.executeDefault(relativePath); // scopeEmitter.executeDefault(relativePath);
} // }
scopeEmitter.removeContext(); // scopeEmitter.removeContext();
} else { // } else {
if (MdaEnv.getContext().getEmitter() instanceof AbstractAutoCompileEmitter) { // if (MdaEnv.getContext().getEmitter() instanceof AbstractAutoCompileEmitter) {
((AbstractAutoCompileEmitter) MdaEnv.getContext().getEmitter()).executePostDefault(fieldPath); // ((AbstractAutoCompileEmitter) MdaEnv.getContext().getEmitter()).executePostDefault(fieldPath);
} else { // } else {
MdaEnv.getContext().getEmitter().executeDefault(fieldPath); // MdaEnv.getContext().getEmitter().executeDefault(fieldPath);
} // }
} // }
} // }
} else // } else
MdaEnv.getContext().getEmitter().executeDefault(module.getPath()); // 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