本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}