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


Java UtilXml.checkEmpty方法代码示例

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


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

示例1: 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

示例2: ModelAlias

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public ModelAlias(Element aliasElement) {
    this.entityAlias = UtilXml.checkEmpty(aliasElement.getAttribute("entity-alias")).intern();
    this.name = UtilXml.checkEmpty(aliasElement.getAttribute("name")).intern();
    this.field = UtilXml.checkEmpty(aliasElement.getAttribute("field"), this.name).intern();
    this.colAlias = UtilXml.checkEmpty(aliasElement.getAttribute("col-alias"), ModelUtil.javaNameToDbName(UtilXml.checkEmpty(this.name))).intern();
    String primKeyValue = UtilXml.checkEmpty(aliasElement.getAttribute("prim-key"));

    if (UtilValidate.isNotEmpty(primKeyValue)) {
        this.isPk = Boolean.valueOf("true".equals(primKeyValue));
    } else {
        this.isPk = null;
    }
    this.groupBy = "true".equals(UtilXml.checkEmpty(aliasElement.getAttribute("group-by")));
    this.function = UtilXml.checkEmpty(aliasElement.getAttribute("function")).intern();
    this.fieldSet = UtilXml.checkEmpty(aliasElement.getAttribute("field-set")).intern();
    this.isFromAliasAll = false;
    this.description = UtilXml.checkEmpty(UtilXml.childElementValue(aliasElement, "description")).intern();

    Element complexAliasElement = UtilXml.firstChildElement(aliasElement, "complex-alias");
    if (complexAliasElement != null) {
        complexAliasMember = new ComplexAlias(complexAliasElement);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:24,代码来源:ModelViewEntity.java

示例3: populateBasicInfo

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
protected void populateBasicInfo(Element entityElement) {
    this.entityName = UtilXml.checkEmpty(entityElement.getAttribute("entity-name")).intern();
    this.tableName = UtilXml.checkEmpty(entityElement.getAttribute("table-name"), ModelUtil.javaNameToDbName(this.entityName)).intern();
    this.packageName = UtilXml.checkEmpty(entityElement.getAttribute("package-name")).intern();
    this.dependentOn = UtilXml.checkEmpty(entityElement.getAttribute("dependent-on")).intern();
    this.doLock = UtilXml.checkBoolean(entityElement.getAttribute("enable-lock"), false);
    this.noAutoStamp = UtilXml.checkBoolean(entityElement.getAttribute("no-auto-stamp"), false);
    this.neverCache = UtilXml.checkBoolean(entityElement.getAttribute("never-cache"), false);
    this.neverCheck = UtilXml.checkBoolean(entityElement.getAttribute("never-check"), false);
    this.autoClearCache = UtilXml.checkBoolean(entityElement.getAttribute("auto-clear-cache"), true);

    String sequenceBankSizeStr = UtilXml.checkEmpty(entityElement.getAttribute("sequence-bank-size"));
    if (UtilValidate.isNotEmpty(sequenceBankSizeStr)) {
        try {
            this.sequenceBankSize = Integer.valueOf(sequenceBankSizeStr);
        } catch (NumberFormatException e) {
            Debug.logError("Error parsing sequence-bank-size value [" + sequenceBankSizeStr + "] for entity [" + this.entityName + "]", module);
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:21,代码来源:ModelEntity.java

示例4: getCDATADef

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private String getCDATADef(Element baseElement, String tagName) {
    String value = "";
    NodeList nl = baseElement.getElementsByTagName(tagName);

    // if there are more then one decriptions we will use only the first one
    if (nl.getLength() > 0) {
        Node n = nl.item(0);
        NodeList childNodes = n.getChildNodes();

        if (childNodes.getLength() > 0) {
            Node cdata = childNodes.item(0);

            value = UtilXml.checkEmpty(cdata.getNodeValue());
        }
    }
    return value;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:18,代码来源:ModelServiceReader.java

示例5: Image

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public Image(Element imageElement) {
    this.borderExdr = FlexibleStringExpander
            .getInstance(UtilXml.checkEmpty(imageElement.getAttribute("border"), "0"));
    this.heightExdr = FlexibleStringExpander.getInstance(imageElement.getAttribute("height"));
    this.idExdr = FlexibleStringExpander.getInstance(imageElement.getAttribute("id"));
    this.srcExdr = FlexibleStringExpander.getInstance(imageElement.getAttribute("src"));
    this.styleExdr = FlexibleStringExpander.getInstance(imageElement.getAttribute("style"));
    this.urlMode = UtilXml.checkEmpty(imageElement.getAttribute("url-mode"), "content");
    this.widthExdr = FlexibleStringExpander.getInstance(imageElement.getAttribute("width"));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:11,代码来源:ModelTree.java

示例6: Label

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public Label(Element labelElement) {
    String textAttr = labelElement.getAttribute("text");
    String pcdata = UtilXml.checkEmpty(UtilXml.elementValue(labelElement), "");
    this.textExdr = FlexibleStringExpander.getInstance(textAttr + pcdata);
    this.idExdr = FlexibleStringExpander.getInstance(labelElement.getAttribute("id"));
    this.styleExdr = FlexibleStringExpander.getInstance(labelElement.getAttribute("style"));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:ModelTree.java

示例7: Link

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public Link(Element linkElement) {
    this.encode = "true".equals(linkElement.getAttribute("encode")) ? Boolean.TRUE : ("false".equals(linkElement.getAttribute("encode")) ? Boolean.FALSE : null); // SCIPIO: changed from boolean to Boolean
    this.fullPath = "true".equals(linkElement.getAttribute("full-path")) ? Boolean.TRUE : ("false".equals(linkElement.getAttribute("full-path")) ? Boolean.FALSE : null); // SCIPIO: changed from boolean to Boolean
    this.idExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("id"));
    Element imageElement = UtilXml.firstChildElement(linkElement, "image");
    if (imageElement != null) {
        this.image = new Image(imageElement);
    } else {
        this.image = null;
    }
    this.linkType = linkElement.getAttribute("link-type");
    this.nameExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("name"));
    List<? extends Element> parameterElementList = UtilXml.childElementList(linkElement, "parameter");
    if (!parameterElementList.isEmpty()) {
        List<Parameter> parameterList = new ArrayList<Parameter>(parameterElementList.size());
        for (Element parameterElement : parameterElementList) {
            parameterList.add(new Parameter(parameterElement));
        }
        this.parameterList = Collections.unmodifiableList(parameterList);
    } else {
        this.parameterList = Collections.emptyList();
    }
    this.prefixExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("prefix"));
    this.secure = "true".equals(linkElement.getAttribute("secure")) ? Boolean.TRUE : ("false".equals(linkElement.getAttribute("secure")) ? Boolean.FALSE : null); // SCIPIO: changed from boolean to Boolean
    this.styleExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("style"));
    this.targetExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("target"));
    this.targetWindowExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("target-window"));
    this.textExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("text"));
    this.titleExdr = FlexibleStringExpander.getInstance(linkElement.getAttribute("title"));
    this.urlMode = UtilXml.checkEmpty(linkElement.getAttribute("link-type"), "intra-app");
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:32,代码来源:ModelTree.java

示例8: AutoEntityParameters

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public AutoEntityParameters(Element autoElement) {
    entityName = UtilXml.checkEmpty(autoElement.getAttribute("entity-name"));
    sendIfEmpty = "true".equals(autoElement.getAttribute("send-if-empty"));
    includeType = UtilXml.checkEmpty(autoElement.getAttribute("include"));
    includePk = "pk".equals(includeType) || "all".equals(includeType);
    includeNonPk = "nonpk".equals(includeType) || "all".equals(includeType);
    List<? extends Element> excludes = UtilXml.childElementList(autoElement, "exclude");
    if (excludes != null) {
        for (Element exclude : excludes) {
            if (UtilValidate.isNotEmpty(exclude.getAttribute("field-name"))) {
                excludeList.add(exclude.getAttribute("field-name"));
            }
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:16,代码来源:CommonWidgetModels.java

示例9: AutoServiceParameters

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public AutoServiceParameters(Element autoElement) {
    serviceName = UtilXml.checkEmpty(autoElement.getAttribute("service-name"));
    sendIfEmpty = "true".equals(autoElement.getAttribute("send-if-empty"));
    List<? extends Element> excludes = UtilXml.childElementList(autoElement, "exclude");
    if (excludes != null) {
        for (Element exclude : excludes) {
            if (UtilValidate.isNotEmpty(exclude.getAttribute("field-name"))) {
                excludeList.add(exclude.getAttribute("field-name"));
            }
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:13,代码来源:CommonWidgetModels.java

示例10: createModelField

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private ModelField createModelField(Element fieldElement) {
    ModelField field = new ModelField();
    String tempStr;

    field.name = UtilXml.checkEmpty(fieldElement.getAttribute("name"));

    tempStr = UtilXml.checkEmpty(fieldElement.getAttribute("position"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        field.position = Integer.parseInt(tempStr);
    }
    tempStr = UtilXml.checkEmpty(fieldElement.getAttribute("length"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        field.length = Integer.parseInt(tempStr);
    }

    field.type = UtilXml.checkEmpty(fieldElement.getAttribute("type"));
    field.format = UtilXml.checkEmpty(fieldElement.getAttribute("format"));
    field.validExp = UtilXml.checkEmpty(fieldElement.getAttribute("valid-exp"));
    field.description = UtilXml.checkEmpty(fieldElement.getAttribute("description"));
    field.defaultValue = UtilXml.checkEmpty(fieldElement.getAttribute("default-value"));
    field.refField = UtilXml.checkEmpty(fieldElement.getAttribute("ref-field"));

    tempStr = UtilXml.checkEmpty(fieldElement.getAttribute("prim-key"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        field.isPk = Boolean.parseBoolean(tempStr);
    }

    tempStr = UtilXml.checkEmpty(fieldElement.getAttribute("ignored"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        field.ignored = Boolean.parseBoolean(tempStr);
    }

    tempStr = UtilXml.checkEmpty(fieldElement.getAttribute("expression"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        field.expression = Boolean.parseBoolean(tempStr);
    }

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

示例11: ModelKeyMap

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
/** Data Constructor, if relFieldName is null defaults to fieldName */
public ModelKeyMap(String fieldName, String relFieldName) {
    this.fieldName = fieldName;
    this.relFieldName = UtilXml.checkEmpty(relFieldName, this.fieldName);
    this.fullName = this.fieldName.concat(":").concat(this.relFieldName);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:ModelKeyMap.java

示例12: addExtendEntity

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
public void addExtendEntity(ModelReader reader, Element extendEntityElement) {
    if (extendEntityElement.hasAttribute("enable-lock")) {
        this.doLock = UtilXml.checkBoolean(extendEntityElement.getAttribute("enable-lock"), false);
    }
    
    if (extendEntityElement.hasAttribute("no-auto-stamp")) {
        this.noAutoStamp = UtilXml.checkBoolean(extendEntityElement.getAttribute("no-auto-stamp"), false);
    }
    
    if (extendEntityElement.hasAttribute("auto-clear-cache")) {
        this.autoClearCache = UtilXml.checkBoolean(extendEntityElement.getAttribute("auto-clear-cache"), false);
    }
    
    if (extendEntityElement.hasAttribute("never-cache")) {
        this.neverCache = UtilXml.checkBoolean(extendEntityElement.getAttribute("never-cache"), false);
    }
    
    if (extendEntityElement.hasAttribute("sequence-bank-size")) {
        String sequenceBankSizeStr = UtilXml.checkEmpty(extendEntityElement.getAttribute("sequence-bank-size"));
        if (UtilValidate.isNotEmpty(sequenceBankSizeStr)) {
            try {
                this.sequenceBankSize = Integer.valueOf(sequenceBankSizeStr);
            } catch (NumberFormatException e) {
                Debug.logError("Error parsing sequence-bank-size value [" + sequenceBankSizeStr + "] for entity [" + this.entityName + "]", module);
            }
        }
    }
    
    for (Element fieldElement : UtilXml.childElementList(extendEntityElement, "field")) {
        ModelField newField = ModelField.create(this, fieldElement, false);
        ModelField existingField = this.getField(newField.getName());
        if (existingField != null) {
            // override the existing field's attributes
            // TODO: only overrides of type, colName, description and enable-audit-log are currently supported
            String type = existingField.getType();
            if (!newField.getType().isEmpty()) {
                type = newField.getType();
            }
            String colName = existingField.getColName();
            if (!newField.getColName().isEmpty()) {
                colName = newField.getColName();
            }
            String description = existingField.getDescription();
            if (!newField.getDescription().isEmpty()) {
                description = newField.getDescription();
            }
            boolean enableAuditLog = existingField.getEnableAuditLog();
            if (UtilValidate.isNotEmpty(fieldElement.getAttribute("enable-audit-log"))) {
                enableAuditLog = "true".equals(fieldElement.getAttribute("enable-audit-log"));
            }
            newField = ModelField.create(this, description, existingField.getName(), type, colName, existingField.getColValue(), existingField.getFieldSet(),
                    existingField.getIsNotNull(), existingField.getIsPk(), existingField.getEncryptMethod(), existingField.getIsAutoCreatedInternal(),
                    enableAuditLog, existingField.getValidators());
        }
        // add to the entity as a new field
        synchronized (fieldsLock) {
            if (existingField != null) {
                this.fieldsList.remove(existingField);
            }
            this.fieldsList.add(newField);
            this.fieldsMap.put(newField.getName(), newField);
            if (!newField.getIsPk()) {
                if (existingField != null) {
                    this.nopks.remove(existingField);
                }
                this.nopks.add(newField);
            } else {
                if (existingField != null) {
                    this.pks.remove(existingField);
                }
                this.pks.add(newField);
            }
        }
    }
    this.modelInfo = ModelInfo.createFromAttributes(this.modelInfo, extendEntityElement);
    this.populateRelated(reader, extendEntityElement);
    this.populateIndexes(extendEntityElement);
    this.dependentOn = UtilXml.checkEmpty(extendEntityElement.getAttribute("dependent-on")).intern();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:80,代码来源:ModelEntity.java

示例13: createOverrideDefs

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private void createOverrideDefs(Element baseElement, ModelService service) {
    for (Element overrideElement: UtilXml.childElementList(baseElement, "override")) {
        String name = UtilXml.checkEmpty(overrideElement.getAttribute("name"));
        ModelParam param = service.getParam(name);
        boolean directToParams = true;
        if (param == null) {
            if (!service.inheritedParameters && (service.implServices.size() > 0 || "group".equals(service.engineName))) {
                // create a temp def to place in the ModelService
                // this will get read when we read implemented services
                directToParams = false;
                param = new ModelParam();
                param.name = name;
            } else {
                Debug.logWarning("No parameter found for override parameter named: " + name + " in service " + service.name, module);
            }
        }

        if (param != null) {
            // set only modified values
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("type"))) {
                param.type = UtilXml.checkEmpty(overrideElement.getAttribute("type")).intern();
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("mode"))) {
                param.mode = UtilXml.checkEmpty(overrideElement.getAttribute("mode")).intern();
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("entity-name"))) {
               param.entityName = UtilXml.checkEmpty(overrideElement.getAttribute("entity-name")).intern();
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("field-name"))) {
                param.fieldName = UtilXml.checkEmpty(overrideElement.getAttribute("field-name")).intern();
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("form-label"))) {
                param.formLabel = UtilXml.checkEmpty(overrideElement.getAttribute("form-label")).intern();
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("optional"))) {
                param.optional = "true".equalsIgnoreCase(overrideElement.getAttribute("optional")); // default to true
                param.overrideOptional = true;
            }
            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("form-display"))) {
                param.formDisplay = !"false".equalsIgnoreCase(overrideElement.getAttribute("form-display")); // default to false
                param.overrideFormDisplay = true;
            }

            if (UtilValidate.isNotEmpty(overrideElement.getAttribute("allow-html"))) {
                param.allowHtml = UtilXml.checkEmpty(overrideElement.getAttribute("allow-html")).intern();
            }

            // default value
            String defValue = overrideElement.getAttribute("default-value");
            if (UtilValidate.isNotEmpty(defValue)) {
                param.setDefaultValue(defValue);
            }

            // override validators
            this.addValidators(overrideElement, param);

            if (directToParams) {
                service.addParam(param);
            } else {
                service.overrideParameters.add(param);
            }
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:65,代码来源:ModelServiceReader.java

示例14: createModelDataFiles

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private Map<String, ModelDataFile> createModelDataFiles() throws DataFileException {
    Document document = null;
    Element docElement = null;
    try {
        document = UtilXml.readXmlDocument(this.readerURL);
    } catch (Exception e) {
        Debug.logWarning(e, "Error while reading " + this.readerURL + ": ", module);
        throw new DataFileException("Error while reading " + this.readerURL, e);
    }
    if (document != null) {
        docElement = document.getDocumentElement();
    }
    if (docElement == null) {
        Debug.logWarning("Document element not found in " + this.readerURL, module);
        throw new DataFileException("Document element not found in " + this.readerURL);
    }
    docElement.normalize();
    List<? extends Element> dataFileElements = UtilXml.childElementList(docElement, "data-file");
    if (dataFileElements.size() == 0) {
        Debug.logWarning("No <data-file> elements found in " + this.readerURL, module);
        throw new DataFileException("No <data-file> elements found in " + this.readerURL);
    }
    Map<String, ModelDataFile> result = new HashMap<String, ModelDataFile>();
    for (Element curDataFile : dataFileElements) {
        String dataFileName = UtilXml.checkEmpty(curDataFile.getAttribute("name"));
        if (result.containsKey(dataFileName)) {
            Debug.logWarning("DataFile " + dataFileName + " is defined more than once, most recent will over-write previous definition(s)", module);
        }
        ModelDataFile dataFile = createModelDataFile(curDataFile);
        if (dataFile != null) {
            result.put(dataFileName, dataFile);
            if (Debug.verboseOn()) {
                Debug.logVerbose("Loaded dataFile: " + dataFileName, module);
            }
        } else {
            Debug.logWarning("Could not create dataFile for dataFileName " + dataFileName, module);
            throw new DataFileException("Could not create dataFile for " + dataFileName + " defined in " + this.readerURL);
        }
    }
    return result;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:42,代码来源:ModelDataFileReader.java

示例15: createModelRecord

import org.ofbiz.base.util.UtilXml; //导入方法依赖的package包/类
private ModelRecord createModelRecord(Element recordElement) {
    ModelRecord record = new ModelRecord();
    String tempStr;

    record.name = UtilXml.checkEmpty(recordElement.getAttribute("name"));
    record.typeCode = UtilXml.checkEmpty(recordElement.getAttribute("type-code"));

    record.tcMin = UtilXml.checkEmpty(recordElement.getAttribute("tc-min"));
    if (record.tcMin.length() > 0)
        record.tcMinNum = Long.parseLong(record.tcMin);
    record.tcMax = UtilXml.checkEmpty(recordElement.getAttribute("tc-max"));
    if (record.tcMax.length() > 0)
        record.tcMaxNum = Long.parseLong(record.tcMax);

    tempStr = UtilXml.checkEmpty(recordElement.getAttribute("tc-isnum"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        record.tcIsNum = Boolean.parseBoolean(tempStr);
    }

    tempStr = UtilXml.checkEmpty(recordElement.getAttribute("tc-position"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        record.tcPosition = Integer.parseInt(tempStr);
    }
    tempStr = UtilXml.checkEmpty(recordElement.getAttribute("tc-length"));
    if (UtilValidate.isNotEmpty(tempStr)) {
        record.tcLength = Integer.parseInt(tempStr);
    }

    record.description = UtilXml.checkEmpty(recordElement.getAttribute("description"));
    record.parentName = UtilXml.checkEmpty(recordElement.getAttribute("parent-name"));
    record.limit = UtilXml.checkEmpty(recordElement.getAttribute("limit"));

    NodeList fList = recordElement.getElementsByTagName("field");
    int priorEnd = -1;

    for (int i = 0; i < fList.getLength(); i++) {
        Element fieldElement = (Element) fList.item(i);
        ModelField modelField = createModelField(fieldElement);

        // if the position is not specified, assume the start position based on last entry
        if ((i > 0) && (modelField.position == -1)) {
            modelField.position = priorEnd;
        }
        priorEnd = modelField.position + modelField.length;
        record.fields.add(modelField);
    }

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


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