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


Java UtilXml.childElementList方法代码示例

本文整理汇总了Java中org.ofbiz.base.util.UtilXml.childElementList方法的典型用法代码示例。如果您正苦于以下问题:Java UtilXml.childElementList方法的具体用法?Java UtilXml.childElementList怎么用?Java UtilXml.childElementList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ofbiz.base.util.UtilXml的用法示例。


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

示例1: readGridDocument

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public static Map<String, ModelGrid> readGridDocument(Document gridFileDoc, ModelReader entityModelReader, DispatchContext dispatchContext, String gridLocation) {
    Map<String, ModelGrid> modelGridMap = new HashMap<String, ModelGrid>();
    if (gridFileDoc != null) {
        // read document and construct ModelGrid for each grid element
        Element rootElement = gridFileDoc.getDocumentElement();
        List<? extends Element> gridElements = UtilXml.childElementList(rootElement, "grid");
        for (Element gridElement : gridElements) {
            String gridName = gridElement.getAttribute("name");
            String cacheKey = gridLocation + "#" + gridName;
            ModelGrid modelGrid = gridLocationCache.get(cacheKey);
            if (modelGrid == null) {
                modelGrid = createModelGrid(gridElement, entityModelReader, dispatchContext, gridLocation, gridName);
                modelGrid = gridLocationCache.putIfAbsentAndGet(cacheKey, modelGrid);
            }
            modelGridMap.put(gridName, modelGrid);
        }
    }
    return modelGridMap;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:GridFactory.java

示例2: getMessageList

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private static List<String> getMessageList(Document responseDocument) {

        List<String> messageList = new ArrayList<String>();

        Element engineDocElement = UtilXml.firstChildElement(responseDocument.getDocumentElement(), "EngineDoc");
        Element messageListElement = UtilXml.firstChildElement(engineDocElement, "MessageList");
        List<? extends Element> messageElementList = UtilXml.childElementList(messageListElement, "Message");
        if (UtilValidate.isNotEmpty(messageElementList)) {
            for (Iterator<? extends Element> i = messageElementList.iterator(); i.hasNext();) {
                Element messageElement = i.next();
                int severity = 0;
                try {
                    severity = Integer.parseInt(UtilXml.childElementValue(messageElement, "Sev"));
                } catch (NumberFormatException nfe) {
                    Debug.logError("Error parsing message severity: " + nfe.getMessage(), module);
                    severity = 9;
                }
                String message = "[" + UtilXml.childElementValue(messageElement, "Audience") + "] " +
                        UtilXml.childElementValue(messageElement, "Text") + " (" + severity + ")";
                messageList.add(message);
            }
        }

        return messageList;
    }
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:26,代码来源:CCPaymentServices.java

示例3: create

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
/**
 * Returns a new <code>ModelIndex</code> instance, initialized with the specified values.
 * 
 * @param modelEntity The <code>ModelEntity</code> this index is a member of.
 * @param indexElement The <code>&lt;index&gt;</code> element containing the values for this index.
 */
public static ModelIndex create(ModelEntity modelEntity, Element indexElement) {
    String name = indexElement.getAttribute("name").intern();
    boolean unique = "true".equals(indexElement.getAttribute("unique"));
    String description = UtilXml.childElementValue(indexElement, "description");
    List<Field>fields = Collections.emptyList();
    List<? extends Element> elementList = UtilXml.childElementList(indexElement, "index-field");
    if (!elementList.isEmpty()) {
        fields = new ArrayList<Field>(elementList.size());
        for (Element indexFieldElement : elementList) {
            String fieldName = indexFieldElement.getAttribute("name").intern();
            String function = indexFieldElement.getAttribute("function").intern();
            fields.add(new Field(fieldName, UtilValidate.isNotEmpty(function) ? Function.valueOf(function.toUpperCase()) : null));
        }
        fields = Collections.unmodifiableList(fields);
    }
    return new ModelIndex(modelEntity, description, name, fields, unique);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:24,代码来源:ModelIndex.java

示例4: ModelAliasAll

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public ModelAliasAll(Element aliasAllElement) {
    this.entityAlias = UtilXml.checkEmpty(aliasAllElement.getAttribute("entity-alias")).intern();
    this.prefix = UtilXml.checkEmpty(aliasAllElement.getAttribute("prefix")).intern();
    this.groupBy = "true".equals(UtilXml.checkEmpty(aliasAllElement.getAttribute("group-by")));
    this.function = UtilXml.checkEmpty(aliasAllElement.getAttribute("function"));
    this.fieldSet = UtilXml.checkEmpty(aliasAllElement.getAttribute("field-set")).intern();

    List<? extends Element> excludes = UtilXml.childElementList(aliasAllElement, "exclude");
    if (UtilValidate.isNotEmpty(excludes)) {
        this.fieldsToExclude = new HashSet<String>();
        for (Element excludeElement: excludes) {
            this.fieldsToExclude.add(excludeElement.getAttribute("field").intern());
        }
    } else {
        this.fieldsToExclude = null;
    }

}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:19,代码来源:ModelViewEntity.java

示例5: getLabelsFromOfbizComponents

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private void getLabelsFromOfbizComponents() throws IOException, SAXException, ParserConfigurationException {
    List<File> componentsFiles = FileUtil.findXmlFiles(null, null, "ofbiz-component", "http://ofbiz.apache.org/dtds/ofbiz-component.xsd");
    for (File componentFile : componentsFiles) {
        String filePath = componentFile.getPath();
        Document menuDocument = UtilXml.readXmlDocument(componentFile.toURI().toURL());
        Element rootElem = menuDocument.getDocumentElement();
        for (Element elem1 : UtilXml.childElementList(rootElem)) {
            checkOfbizComponentTag(elem1, filePath);
            for (Element elem2 : UtilXml.childElementList(elem1)) {
                checkOfbizComponentTag(elem2, filePath);
            }
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:15,代码来源:LabelReferences.java

示例6: readTreeDocument

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public static Map<String, ModelTree> readTreeDocument(Document treeFileDoc, Delegator delegator, LocalDispatcher dispatcher, String treeLocation) {
    Map<String, ModelTree> modelTreeMap = new HashMap<String, ModelTree>();
    if (treeFileDoc != null) {
        // read document and construct ModelTree for each tree element
        Element rootElement = treeFileDoc.getDocumentElement();
        for (Element treeElement: UtilXml.childElementList(rootElement, "tree")) {
            ModelTree modelTree = new ModelTree(treeElement, treeLocation);
            modelTreeMap.put(modelTree.getName(), modelTree);
        }
    }
    return modelTreeMap;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:13,代码来源:TreeFactory.java

示例7: RenderInitSettings

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public RenderInitSettings(ModelScreenSettings modelScreenSettings, Element autoSettingsElement, String sourceLocation) {
    List<? extends Element> childElements = UtilXml.childElementList(autoSettingsElement, "local");
    if (UtilValidate.isNotEmpty(childElements)) {
        this.localSettings = new LocalSettings(modelScreenSettings, childElements.get(0), sourceLocation);
    } else {
        this.localSettings = new LocalSettings();
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:9,代码来源:ModelScreenSettings.java

示例8: ModelScreenSettings

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public ModelScreenSettings(Element settingsElement, String sourceLocation) {
    super(settingsElement);
    this.location = sourceLocation;
    List<? extends Element> childElementList;
    
    childElementList = UtilXml.childElementList(settingsElement, "auto-include-settings");
    if (UtilValidate.isNotEmpty(childElementList)) {
        this.autoIncludeSettings = new AutoIncludeSettings(childElementList.get(0), sourceLocation);
    } else {
        this.autoIncludeSettings = null;
    }  
    
    childElementList = UtilXml.childElementList(settingsElement, "decorator-screen-settings");
    if (UtilValidate.isNotEmpty(childElementList)) {
        this.decoratorScreenSettings = new DecoratorScreenSettings(childElementList.get(0), sourceLocation);
    } else {
        this.decoratorScreenSettings = defaultDecoratorScreenSettings;
    }  
    
    childElementList = UtilXml.childElementList(settingsElement, "render-init");
    if (UtilValidate.isNotEmpty(childElementList)) {
        this.renderInitSettings = new RenderInitSettings(this, childElementList.get(0), sourceLocation);
    } else {
        this.renderInitSettings = null;
    }  
    this.active = UtilMisc.booleanValue(settingsElement.getAttribute("active"));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:28,代码来源:ModelScreenSettings.java

示例9: createGroupDefs

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private void createGroupDefs(Element baseElement, ModelService service) {
    List<? extends Element> group = UtilXml.childElementList(baseElement, "group");
    if (UtilValidate.isNotEmpty(group)) {
        Element groupElement = group.get(0);
        groupElement.setAttribute("name", "_" + service.name + ".group");
        service.internalGroup = new GroupModel(groupElement);
        service.invoke = service.internalGroup.getGroupName();
        if (Debug.verboseOn()) Debug.logVerbose("Created INTERNAL GROUP model [" + service.internalGroup + "]", module);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:ModelServiceReader.java

示例10: ColumnContainer

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public ColumnContainer(ModelScreen modelScreen, Element containerElement) {
    super(modelScreen, containerElement);
    this.idExdr = FlexibleStringExpander.getInstance(containerElement.getAttribute("id"));
    this.styleExdr = FlexibleStringExpander.getInstance(containerElement.getAttribute("style"));
    List<? extends Element> subElementList = UtilXml.childElementList(containerElement, "column");
    List<Column> columns = new ArrayList<Column>(subElementList.size());
    for (Element element : subElementList) {
        columns.add(new Column(modelScreen, element));
    }
    this.columns = Collections.unmodifiableList(columns);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:12,代码来源:ModelScreenWidget.java

示例11: LocalSettings

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public LocalSettings(ModelScreenSettings modelScreenSettings, Element autoSettingsElement, String sourceLocation) {
    ArrayList<ModelAction> actions = new ArrayList<>();
    List<? extends Element> childElements = UtilXml.childElementList(autoSettingsElement, "actions");
    for (Element childElement: childElements) {
        actions.addAll(AbstractModelAction.readSubActions(modelScreenSettings, childElement));
    }
    actions.trimToSize();
    this.actions = Collections.unmodifiableList(actions);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:10,代码来源:ModelScreenSettings.java

示例12: ViewEntityCondition

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public ViewEntityCondition(ModelViewEntity modelViewEntity, ModelViewLink modelViewLink, Element element) {
    this.modelViewEntity = modelViewEntity;
    this.modelViewLink = modelViewLink;
    this.filterByDate = "true".equals(element.getAttribute("filter-by-date"));
    this.distinct = "true".equals(element.getAttribute("distinct"));
    // process order-by
    List<? extends Element> orderByElementList = UtilXml.childElementList(element, "order-by");
    if (orderByElementList.size() > 0) {
        orderByList = new ArrayList<String>(orderByElementList.size());
        for (Element orderByElement: orderByElementList) {
            orderByList.add(orderByElement.getAttribute("field-name"));
        }
    } else {
        orderByList = null;
    }

    Element conditionExprElement = UtilXml.firstChildElement(element, "condition-expr");
    Element conditionListElement = UtilXml.firstChildElement(element, "condition-list");
    if (conditionExprElement != null) {
        this.whereCondition = new ViewConditionExpr(this, conditionExprElement);
    } else if (conditionListElement != null) {
        this.whereCondition = new ViewConditionList(this, conditionListElement);
    } else {
        this.whereCondition = null;
    }

    Element havingConditionListElement = UtilXml.firstChildElement(element, "having-condition-list");
    if (havingConditionListElement != null) {
        this.havingCondition = new ViewConditionList(this, havingConditionListElement);
    } else {
        this.havingCondition = null;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:34,代码来源:ModelViewEntity.java

示例13: CalcOp

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private CalcOp(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.attributeNames(simpleMethod, element, "field", "operator");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "operator");
        MiniLangValidate.expressionAttributes(simpleMethod, element, "field");
        MiniLangValidate.childElements(simpleMethod, element, "calcop", "number");
    }
    this.fieldFma = FlexibleMapAccessor.getInstance(element.getAttribute("field"));
    String operatorStr = element.getAttribute("operator");
    int operator = CalcOp.OPERATOR_ADD;
    if ("subtract".equals(operatorStr)) {
        operator = CalcOp.OPERATOR_SUBTRACT;
    } else if ("multiply".equals(operatorStr)) {
        operator = CalcOp.OPERATOR_MULTIPLY;
    } else if ("divide".equals(operatorStr)) {
        operator = CalcOp.OPERATOR_DIVIDE;
    } else if ("negative".equals(operatorStr)) {
        operator = CalcOp.OPERATOR_NEGATIVE;
    }
    this.operator = operator;
    List<? extends Element> calcopElements = UtilXml.childElementList(element);
    calcops = new Calculate.SubCalc[calcopElements.size()];
    int i = 0;
    for (Element calcopElement : calcopElements) {
        if ("calcop".equals(calcopElement.getNodeName())) {
            calcops[i] = new Calculate.CalcOp(calcopElement, simpleMethod);
        } else if ("number".equals(calcopElement.getNodeName())) {
            calcops[i] = new Calculate.NumberOp(calcopElement, simpleMethod);
        } else {
            MiniLangValidate.handleError("Invalid calculate sub-element.", simpleMethod, calcopElement);
            calcops[i] = new InvalidOp(calcopElement, simpleMethod);
        }
        i++;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:37,代码来源:Calculate.java

示例14: createImplDefs

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private void createImplDefs(Element baseElement, ModelService service) {
    for (Element implement: UtilXml.childElementList(baseElement, "implements")) {
        String serviceName = UtilXml.checkEmpty(implement.getAttribute("service")).intern();
        boolean optional = UtilXml.checkBoolean(implement.getAttribute("optional"), false);
        if (serviceName.length() > 0)
            service.implServices.add(new ModelServiceIface(serviceName, optional));
            //service.implServices.add(serviceName);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:10,代码来源:ModelServiceReader.java

示例15: CallSimpleMethod

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public CallSimpleMethod(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.attributeNames(simpleMethod, element, "method-name", "xml-resource", "scope");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "method-name");
        MiniLangValidate.constantAttributes(simpleMethod, element, "method-name", "xml-resource", "scope");
        MiniLangValidate.childElements(simpleMethod, element, "result-to-field");
    }
    this.methodName = element.getAttribute("method-name");
    String xmlResourceAttribute = element.getAttribute("xml-resource");
    if (xmlResourceAttribute.isEmpty()) {
        xmlResourceAttribute = simpleMethod.getFromLocation();
    }
    this.xmlResource = xmlResourceAttribute;
    URL xmlURL = null;
    try {
        xmlURL = FlexibleLocation.resolveLocation(this.xmlResource);
    } catch (MalformedURLException e) {
        MiniLangValidate.handleError("Could not find SimpleMethod XML document in resource: " + this.xmlResource + "; error was: " + e.toString(), simpleMethod, element);
    }
    this.xmlURL = xmlURL;
    this.scope = element.getAttribute("scope");
    List<? extends Element> resultToFieldElements = UtilXml.childElementList(element, "result-to-field");
    if (UtilValidate.isNotEmpty(resultToFieldElements)) {
        if (!"function".equals(this.scope)) {
            MiniLangValidate.handleError("Inline scope cannot include <result-to-field> elements.", simpleMethod, element);
        }
        List<ResultToField> resultToFieldList = new ArrayList<ResultToField>(resultToFieldElements.size());
        for (Element resultToFieldElement : resultToFieldElements) {
            resultToFieldList.add(new ResultToField(resultToFieldElement, simpleMethod));
        }
        this.resultToFieldList = resultToFieldList;
    } else {
        this.resultToFieldList = null;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:37,代码来源:CallSimpleMethod.java


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