use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsWebConfigBhv method createEntity.
@Override
protected <RESULT extends WebConfig> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable(DfTypeUtil.toBoolean(source.get("available")));
result.setBoost(DfTypeUtil.toFloat(source.get("boost")));
result.setConfigParameter(DfTypeUtil.toString(source.get("configParameter")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setDepth(DfTypeUtil.toInteger(source.get("depth")));
result.setDescription(DfTypeUtil.toString(source.get("description")));
result.setExcludedDocUrls(DfTypeUtil.toString(source.get("excludedDocUrls")));
result.setExcludedUrls(DfTypeUtil.toString(source.get("excludedUrls")));
result.setIncludedDocUrls(DfTypeUtil.toString(source.get("includedDocUrls")));
result.setIncludedUrls(DfTypeUtil.toString(source.get("includedUrls")));
result.setIntervalTime(DfTypeUtil.toInteger(source.get("intervalTime")));
result.setTimeToLive(DfTypeUtil.toInteger(source.get("timeToLive")));
result.setMaxAccessCount(DfTypeUtil.toLong(source.get("maxAccessCount")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setNumOfThread(DfTypeUtil.toInteger(source.get("numOfThread")));
result.setPermissions(toStringArray(source.get("permissions")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setUrls(DfTypeUtil.toString(source.get("urls")));
result.setUserAgent(DfTypeUtil.toString(source.get("userAgent")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsWebConfigToLabelBhv method createEntity.
@Override
protected <RESULT extends WebConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setLabelTypeId(DfTypeUtil.toString(source.get("labelTypeId")));
result.setWebConfigId(DfTypeUtil.toString(source.get("webConfigId")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsKeyMatchBhv method createEntity.
@Override
protected <RESULT extends KeyMatch> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setBoost(DfTypeUtil.toFloat(source.get("boost")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setMaxSize(DfTypeUtil.toInteger(source.get("maxSize")));
result.setQuery(DfTypeUtil.toString(source.get("query")));
result.setTerm(DfTypeUtil.toString(source.get("term")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsLabelToRoleBhv method createEntity.
@Override
protected <RESULT extends LabelToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setLabelTypeId(DfTypeUtil.toString(source.get("labelTypeId")));
result.setRoleTypeId(DfTypeUtil.toString(source.get("roleTypeId")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsPathMappingBhv method createEntity.
@Override
protected <RESULT extends PathMapping> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setProcessType(DfTypeUtil.toString(source.get("processType")));
result.setRegex(DfTypeUtil.toString(source.get("regex")));
result.setReplacement(DfTypeUtil.toString(source.get("replacement")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setUserAgent(DfTypeUtil.toString(source.get("userAgent")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
Aggregations