use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfJsonFreeAgent method throwKeyPathExpectedMapButNotMapException.
protected void throwKeyPathExpectedMapButNotMapException(String requestName, DfFreeGenResource resource, String keyPath, String targetPath, Object current) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The key path expects map type but not map. (FreeGen)");
br.addItem("Request Name");
br.addElement(requestName);
br.addItem("JSON File");
br.addElement(resource.getResourceFile());
br.addItem("keyPath");
br.addElement(keyPath);
br.addItem("Target Path Element");
br.addElement(targetPath);
br.addItem("Actual Object");
br.addElement(current != null ? current.getClass().getName() : null);
br.addElement(current);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfPropTableLoader method throwFreeGenPropReadFailureException.
protected void throwFreeGenPropReadFailureException(String requestName, DfFreeGenResource resource, Map<String, Object> tableMap, Map<String, Map<String, String>> mappingMap, RuntimeException cause) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Failed to read the property for free-gen.");
br.addItem("Current Request");
br.addElement(requestName);
br.addItem("Resource");
br.addElement(resource);
br.addItem("tableMap");
if (!tableMap.isEmpty()) {
for (Entry<String, Object> entry : tableMap.entrySet()) {
br.addElement(entry.getKey() + " = " + entry.getValue());
}
} else {
br.addElement("*empty");
}
br.addItem("mappingMap");
if (!mappingMap.isEmpty()) {
for (Entry<String, Map<String, String>> entry : mappingMap.entrySet()) {
br.addElement(entry.getKey() + " = " + entry.getValue());
}
} else {
br.addElement("*empty");
}
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg, cause);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfElasticsearchLoadingAgent method throwJsonTablePathPropertyNotFoundException.
protected void throwJsonTablePathPropertyNotFoundException() {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the table path in the tableMap property. (FreeGen)");
br.addItem("Request Name");
br.addElement(_requestName);
br.addItem("JSON File");
br.addElement(_resource.getResourceFile());
br.addItem("tableMap");
br.addElement(_mapProp.getOptionMap());
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfBasicProperties method throwBasicInfoSubTypeOnDatabaseUnknownException.
protected void throwBasicInfoSubTypeOnDatabaseUnknownException(String subType) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Unknown value of the property 'subTypeOnDatabase' in basicInfoMap.dfprop.");
br.addItem("Advice");
br.addElement("Only supported types can be set.");
br.addElement("For example, if database is 'sqlserver', databaseSubType can be 'localdb'.");
br.addItem("Target Database");
br.addElement(getTargetDatabase());
br.addItem("SubType on Database");
br.addElement(subType);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfDocumentProperties method getLoadDataReverseXlsLimit.
// -----------------------------------------------------
// XLS Limit
// ---------
public Integer getLoadDataReverseXlsLimit() {
final Map<String, Object> loadDataReverseMap = getLoadDataReverseMap();
String limitExp = null;
if (!loadDataReverseMap.isEmpty()) {
limitExp = (String) loadDataReverseMap.get("xlsLimit");
}
if (limitExp == null) {
// if null, default limit
return null;
}
final Integer limit;
try {
limit = Integer.valueOf(limitExp);
} catch (NumberFormatException e) {
String msg = "The property 'xlsLimit' of loadDataReverse in " + KEY_oldDocumentMap;
msg = msg + " should be number but: value=" + limitExp;
throw new DfIllegalPropertyTypeException(msg, e);
}
if (limit < 0) {
String msg = "The property 'xlsLimit' of loadDataReverse in " + KEY_oldDocumentMap;
msg = msg + " should be zero or plus number but minus: value=" + limit;
throw new DfIllegalPropertySettingException(msg);
}
return limit;
}
Aggregations