本文整理匯總了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();
}