当前位置: 首页>>代码示例>>Java>>正文


Java MethodOperation.exec方法代码示例

本文整理汇总了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;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:22,代码来源:While.java

示例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;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:14,代码来源:SimpleMethod.java

示例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;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:48,代码来源:IterateMap.java


注:本文中的org.ofbiz.minilang.method.MethodOperation.exec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。