Package org.ofbiz.minilang.method

Examples of org.ofbiz.minilang.method.MethodOperation


        List<? extends Element> operationElements = UtilXml.childElementList(simpleMethodElement);

        if (UtilValidate.isNotEmpty(operationElements)) {
            for (Element curOperElem: operationElements) {
                String nodeName = curOperElem.getNodeName();
                MethodOperation methodOp = null;

                MethodOperation.Factory 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 {
                    Debug.logWarning("Operation element \"" + nodeName + "\" no recognized", module);
                }
                if (methodOp == null) continue;
                methodOperations.add(methodOp);
                DeprecatedOperation depOp = methodOp.getClass().getAnnotation(DeprecatedOperation.class);
                if (depOp != null) Debug.logInfo("The " + nodeName + " operation has been deprecated in favor of the " + depOp.value() + " operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + methodOp.rawString(), module);
            }
        }
    }
View Full Code Here


        List<? extends Element> operationElements = UtilXml.childElementList(simpleMethodElement);

        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 {
                    Debug.logWarning("Operation element \"" + nodeName + "\" no recognized", module);
                }
                if (methodOp == null) continue;
                methodOperations.add(methodOp);
                DeprecatedOperation depOp = methodOp.getClass().getAnnotation(DeprecatedOperation.class);
                if (depOp != null) Debug.logInfo("The " + nodeName + " operation has been deprecated in favor of the " + depOp.value() + " operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + methodOp.rawString(), module);
            }
        }
    }
View Full Code Here

        List<? extends Element> operationElements = UtilXml.childElementList(simpleMethodElement);

        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 {
                    Debug.logWarning("Operation element \"" + nodeName + "\" no recognized", module);
                }
                if (methodOp == null) continue;
                if (UtilProperties.propertyValueEquals("webslinger-invoker.properties", "wrap-calls", "true")) {
                    Wrap<MethodOperation> wrap = new Wrap<MethodOperation>().fileName(simpleMethod.getLocationAndName()).wrappedClass(methodOp.getClass());
                    wrap.wrap(methodOperationExecMethod);
                    Object startLine = curOperElem.getUserData("startLine");
                    if (startLine != null) {
                        wrap.lineNumber(((Integer) startLine).intValue());
                    }
                    methodOp = wrap.newInstance(new Class<?>[] {Element.class, SimpleMethod.class}, new Object[] {curOperElem, simpleMethod});
                }
                methodOperations.add(methodOp);
                DeprecatedOperation depOp = methodOp.getClass().getAnnotation(DeprecatedOperation.class);
                if (depOp != null) Debug.logInfo("The " + nodeName + " operation has been deprecated in favor of the " + depOp.value() + " operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + methodOp.rawString(), module);
            }
        }
    }
View Full Code Here

                } else if ("set".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.SetOperation(curOperElem, simpleMethod));
                } else if ("set-calendar".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.SetCalendar(curOperElem, simpleMethod));
                } else if ("env-to-env".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.EnvToEnv(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The env-to-env operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("env-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.EnvToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The env-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("field-to-env".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.FieldToEnv(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The field-to-env operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("field-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.FieldToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The field-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("string-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.StringToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The string-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);

                } else if ("string-append".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.StringAppend(curOperElem, simpleMethod));
                } else if ("string-to-list".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.StringToList(curOperElem, simpleMethod));
View Full Code Here

                    methodOperations.add(new org.ofbiz.minilang.method.envops.OrderMapList(curOperElem, simpleMethod));

                } else if ("set".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.SetOperation(curOperElem, simpleMethod));
                } else if ("env-to-env".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.EnvToEnv(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The env-to-env operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("env-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.EnvToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The env-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("field-to-env".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.FieldToEnv(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The field-to-env operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("field-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.FieldToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The field-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);
                } else if ("string-to-field".equals(nodeName)) {
                    MethodOperation mop = new org.ofbiz.minilang.method.envops.StringToField(curOperElem, simpleMethod);
                    methodOperations.add(mop);
                    Debug.logInfo("The string-to-field operation has been deprecated in favor of the set operation; found use of this in [" + simpleMethod.getShortDescription() + "]: " + mop.rawString(), module);

                } else if ("string-append".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.StringAppend(curOperElem, simpleMethod));
                } else if ("string-to-list".equals(nodeName)) {
                    methodOperations.add(new org.ofbiz.minilang.method.envops.StringToList(curOperElem, simpleMethod));
View Full Code Here

     false and stopping if any return false.
     */
    public static boolean runSubOps(List methodOperations, MethodContext methodContext) {
        Iterator methodOpsIter = methodOperations.iterator();
        while (methodOpsIter.hasNext()) {
            MethodOperation methodOperation = (MethodOperation) methodOpsIter.next();
            try {
                if (!methodOperation.exec(methodContext)) {
                    return false;
                }
            } catch (Throwable t) {
                String errMsg = "Error in simple-method operation [" + methodOperation.rawString() + "]: " + t.toString();
                Debug.logError(t, errMsg, module);
                throw new RuntimeException(errMsg);
            }
        }
        return true;
View Full Code Here

TOP

Related Classes of org.ofbiz.minilang.method.MethodOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.