本文整理汇总了Java中org.ofbiz.minilang.method.MethodOperation.exec方法的典型用法代码示例。如果您正苦于以下问题:Java MethodOperation.exec方法的具体用法?Java MethodOperation.exec怎么用?Java MethodOperation.exec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.minilang.method.MethodOperation
的用法示例。
在下文中一共展示了MethodOperation.exec方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exec
import org.ofbiz.minilang.method.MethodOperation; //导入方法依赖的package包/类
@Override
public boolean exec(MethodContext methodContext) throws MiniLangException {
while (condition.checkCondition(methodContext)) {
try {
for (MethodOperation methodOperation : thenSubOps) {
if (!methodOperation.exec(methodContext)) {
return false;
}
}
} catch (MiniLangException e) {
if (e instanceof BreakElementException) {
break;
}
if (e instanceof ContinueElementException) {
continue;
}
throw e;
}
}
return true;
}
示例2: runSubOps
import org.ofbiz.minilang.method.MethodOperation; //导入方法依赖的package包/类
/**
* Execs the given operations returning true if all return true, or returning false and stopping if any return false.
* @throws MiniLangException
*/
public static boolean runSubOps(List<MethodOperation> methodOperations, MethodContext methodContext) throws MiniLangException {
Assert.notNull("methodOperations", methodOperations, "methodContext", methodContext);
for (MethodOperation methodOperation : methodOperations) {
if (!methodOperation.exec(methodContext)) {
return false;
}
}
return true;
}
示例3: exec
import org.ofbiz.minilang.method.MethodOperation; //导入方法依赖的package包/类
@Override
public boolean exec(MethodContext methodContext) throws MiniLangException {
if (mapFma.isEmpty()) {
throw new MiniLangRuntimeException("No map specified.", this);
}
Object oldKey = keyFma.get(methodContext.getEnvMap());
Object oldValue = valueFma.get(methodContext.getEnvMap());
if (oldKey != null) {
if (Debug.verboseOn())
Debug.logVerbose("In iterate-map the key had a non-null value before entering the loop for the operation: " + this, module);
}
if (oldValue != null) {
if (Debug.verboseOn())
Debug.logVerbose("In iterate-map the value had a non-null value before entering the loop for the operation: " + this, module);
}
Map<? extends Object, ? extends Object> theMap = mapFma.get(methodContext.getEnvMap());
if (theMap == null) {
if (Debug.verboseOn())
Debug.logVerbose("Map not found with name " + mapFma + ", doing nothing: " + this, module);
return true;
}
if (theMap.size() == 0) {
if (Debug.verboseOn())
Debug.logVerbose("Map with name " + mapFma + " has zero entries, doing nothing: " + this, module);
return true;
}
for (Map.Entry<? extends Object, ? extends Object> theEntry : theMap.entrySet()) {
keyFma.put(methodContext.getEnvMap(), theEntry.getKey());
valueFma.put(methodContext.getEnvMap(), theEntry.getValue());
try {
for (MethodOperation methodOperation : subOps) {
if (!methodOperation.exec(methodContext)) {
return false;
}
}
} catch (MiniLangException e) {
if (e instanceof BreakElementException) {
break;
}
if (e instanceof ContinueElementException) {
continue;
}
throw e;
}
}
return true;
}