本文整理汇总了Java中org.ofbiz.minilang.method.MethodOperation类的典型用法代码示例。如果您正苦于以下问题:Java MethodOperation类的具体用法?Java MethodOperation怎么用?Java MethodOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodOperation类属于org.ofbiz.minilang.method包,在下文中一共展示了MethodOperation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: readOperations
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
public static List<MethodOperation> readOperations(Element simpleMethodElement, SimpleMethod simpleMethod) throws MiniLangException {
Assert.notNull("simpleMethodElement", simpleMethodElement, "simpleMethod", simpleMethod);
List<? extends Element> operationElements = UtilXml.childElementList(simpleMethodElement);
ArrayList<MethodOperation> methodOperations = new ArrayList<MethodOperation>(operationElements.size());
if (UtilValidate.isNotEmpty(operationElements)) {
for (Element curOperElem : operationElements) {
String nodeName = curOperElem.getNodeName();
MethodOperation methodOp = null;
MethodOperation.Factory<MethodOperation> factory = methodOperationFactories.get(nodeName);
if (factory != null) {
methodOp = factory.createMethodOperation(curOperElem, simpleMethod);
} else if ("else".equals(nodeName)) {
// don't add anything, but don't complain either, this one is handled in the individual operations
} else {
MiniLangValidate.handleError("Invalid element found", simpleMethod, curOperElem);
}
if (methodOp == null) {
continue;
}
methodOperations.add(methodOp);
DeprecatedOperation depOp = methodOp.getClass().getAnnotation(DeprecatedOperation.class);
if (depOp != null) {
MiniLangValidate.handleError("The " + nodeName + " operation has been deprecated in favor of the " + depOp.value() + " operation", simpleMethod, curOperElem);
}
}
}
methodOperations.trimToSize();
return methodOperations;
}
示例3: 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;
}
示例4: gatherArtifactInfo
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
@Override
public void gatherArtifactInfo(ArtifactInfoContext aic) {
for (MethodOperation methodOp : this.methodOperations) {
methodOp.gatherArtifactInfo(aic);
}
}
示例5: getMethodOperations
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
public List<MethodOperation> getMethodOperations() {
return this.methodOperations;
}
示例6: 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;
}
示例7: gatherArtifactInfo
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
@Override
public void gatherArtifactInfo(ArtifactInfoContext aic) {
for (MethodOperation method : this.subOps) {
method.gatherArtifactInfo(aic);
}
}
示例8: gatherArtifactInfo
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
@Override
public void gatherArtifactInfo(ArtifactInfoContext aic) {
for (MethodOperation method : this.thenSubOps) {
method.gatherArtifactInfo(aic);
}
}
示例9: getThenSubOps
import org.ofbiz.minilang.method.MethodOperation; //导入依赖的package包/类
public List<MethodOperation> getThenSubOps() {
return this.thenSubOps;
}