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


Java MethodObject类代码示例

本文整理汇总了Java中org.ofbiz.minilang.method.MethodObject的典型用法代码示例。如果您正苦于以下问题:Java MethodObject类的具体用法?Java MethodObject怎么用?Java MethodObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MethodObject类属于org.ofbiz.minilang.method包,在下文中一共展示了MethodObject类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CallObjectMethod

import org.ofbiz.minilang.method.MethodObject; //导入依赖的package包/类
public CallObjectMethod(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.handleError("<call-object-method> element is deprecated (use <script>)", simpleMethod, element);
        MiniLangValidate.attributeNames(simpleMethod, element, "obj-field", "method-name", "ret-field");
        MiniLangValidate.constantAttributes(simpleMethod, element, "method-name");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "obj-field", "method-name");
        MiniLangValidate.childElements(simpleMethod, element, "string", "field");
    }
    this.methodName = element.getAttribute("method-name");
    this.objFieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("obj-field"));
    this.retFieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("ret-field"));
    List<? extends Element> parameterElements = UtilXml.childElementList(element);
    if (parameterElements.size() > 0) {
        ArrayList<MethodObject<?>> parameterList = new ArrayList<MethodObject<?>>(parameterElements.size());
        for (Element parameterElement : parameterElements) {
            if ("string".equals(parameterElement.getNodeName())) {
                parameterList.add(new StringObject(parameterElement, simpleMethod));
            } else if ("field".equals(parameterElement.getNodeName())) {
                parameterList.add(new FieldObject<Object>(parameterElement, simpleMethod));
            }
        }
        parameterList.trimToSize();
        this.parameters = Collections.unmodifiableList(parameterList);
    } else {
        this.parameters = null;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:29,代码来源:CallObjectMethod.java

示例2: CallClassMethod

import org.ofbiz.minilang.method.MethodObject; //导入依赖的package包/类
public CallClassMethod(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.handleError("<call-class-method> element is deprecated (use <script>)", simpleMethod, element);
        MiniLangValidate.attributeNames(simpleMethod, element, "class-name", "method-name", "ret-field");
        MiniLangValidate.constantAttributes(simpleMethod, element, "class-name", "method-name");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "class-name", "method-name");
        MiniLangValidate.childElements(simpleMethod, element, "string", "field");
    }
    this.className = element.getAttribute("class-name");
    Class<?> methodClass = null;
    try {
        methodClass = ObjectType.loadClass(this.className);
    } catch (ClassNotFoundException e) {
        MiniLangValidate.handleError("Class not found with name " + this.className, simpleMethod, element);
    }
    this.methodClass = methodClass;
    this.methodName = element.getAttribute("method-name");
    this.retFieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("ret-field"));
    List<? extends Element> parameterElements = UtilXml.childElementList(element);
    if (parameterElements.size() > 0) {
        ArrayList<MethodObject<?>> parameterList = new ArrayList<MethodObject<?>>(parameterElements.size());
        for (Element parameterElement : parameterElements) {
            if ("string".equals(parameterElement.getNodeName())) {
                parameterList.add(new StringObject(parameterElement, simpleMethod));
            } else if ("field".equals(parameterElement.getNodeName())) {
                parameterList.add(new FieldObject<Object>(parameterElement, simpleMethod));
            }
        }
        parameterList.trimToSize();
        this.parameters = Collections.unmodifiableList(parameterList);
    } else {
        this.parameters = null;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:36,代码来源:CallClassMethod.java

示例3: CreateObject

import org.ofbiz.minilang.method.MethodObject; //导入依赖的package包/类
public CreateObject(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.handleError("<create-object> element is deprecated (use <script>)", simpleMethod, element);
        MiniLangValidate.attributeNames(simpleMethod, element, "class-name", "field");
        MiniLangValidate.expressionAttributes(simpleMethod, element, "field");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "class-name", "field");
        MiniLangValidate.childElements(simpleMethod, element, "string", "field");
    }
    className = element.getAttribute("class-name");
    Class<?> targetClass = null;
    try {
        targetClass = ObjectType.loadClass(this.className);
    } catch (ClassNotFoundException e) {
        MiniLangValidate.handleError("Class not found with name " + this.className, simpleMethod, element);
    }
    this.targetClass = targetClass;
    fieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("field"));
    List<? extends Element> parameterElements = UtilXml.childElementList(element);
    if (parameterElements.size() > 0) {
        ArrayList<MethodObject<?>> parameterList = new ArrayList<MethodObject<?>>(parameterElements.size());
        for (Element parameterElement : parameterElements) {
            if ("string".equals(parameterElement.getNodeName())) {
                parameterList.add(new StringObject(parameterElement, simpleMethod));
            } else if ("field".equals(parameterElement.getNodeName())) {
                parameterList.add(new FieldObject<Object>(parameterElement, simpleMethod));
            }
        }
        parameterList.trimToSize();
        this.parameters = Collections.unmodifiableList(parameterList);
    } else {
        this.parameters = null;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:35,代码来源:CreateObject.java


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