本文整理汇总了Java中org.ofbiz.base.util.UtilXml.checkBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java UtilXml.checkBoolean方法的具体用法?Java UtilXml.checkBoolean怎么用?Java UtilXml.checkBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.base.util.UtilXml
的用法示例。
在下文中一共展示了UtilXml.checkBoolean方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例2: 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);
}
}
示例3: 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();
}