use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfWebClsTableLoader method handleRefCls.
protected void handleRefCls(DfClassificationTop classificationTop, DfRefClsElement refClsElement) {
refClsElement.checkFormalRefType(classificationTop);
classificationTop.addRefClsElement(refClsElement);
if (refClsElement.isRefTypeIncluded()) {
final DfClassificationTop dbClsTop = refClsElement.getDBClsTop();
final String groupName = refClsElement.getGroupName();
if (groupName != null) {
final DfClassificationGroup group = dbClsTop.getGroupList().stream().filter(gr -> {
return gr.getGroupName().equals(groupName);
}).findFirst().orElseThrow(() -> {
String msg = "Not found the group name: " + refClsElement.getClassificationName() + "." + groupName;
return new DfIllegalPropertySettingException(msg);
});
classificationTop.addClassificationElementAll(group.getElementList());
} else {
final List<DfClassificationElement> dbElementList = dbClsTop.getClassificationElementList();
classificationTop.addClassificationElementAll(dbElementList);
classificationTop.acceptGroupList(dbClsTop.getGroupList());
}
}
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfWebClsTableLoader method findDBCls.
protected DfClassificationTop findDBCls(String classificationName, String refClsName, Map<String, DfClassificationTop> dbClsMap, DfFreeGenResource resource) {
final DfClassificationTop refTop = dbClsMap.get(refClsName);
if (refTop == null) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the DB classification for web classification.");
br.addItem("Advice");
br.addElement("Make sure your DB classification name.");
br.addItem("WebCls");
br.addElement(classificationName);
br.addItem("NotFound DBCls");
br.addElement(refClsName);
br.addItem("Existing DBCls");
br.addElement(dbClsMap.keySet());
br.addItem("dfprop File");
br.addElement(resource.getResourceFile());
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
return refTop;
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfClassificationGroup method throwClassificationGroupingMapElementNotFoundException.
protected void throwClassificationGroupingMapElementNotFoundException(String elementName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the classification element in the grouping map.");
br.addItem("Classification Name");
br.addElement(_classificationTop.getClassificationName());
br.addItem("Group Name");
br.addElement(_groupName);
br.addItem("NotFound Name");
br.addElement(elementName);
br.addItem("Defined Element");
final List<DfClassificationElement> elementList = _classificationTop.getClassificationElementList();
for (DfClassificationElement element : elementList) {
br.addElement(element);
}
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfClassificationTop method throwDeprecatedClassificationElementNotFoundException.
protected void throwDeprecatedClassificationElementNotFoundException(String deprecated) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the specified element in deprecated list.");
br.addItem("Classification");
br.addElement(_classificationName);
br.addItem("Existing Element");
final StringBuilder sb = new StringBuilder();
for (DfClassificationElement element : _elementList) {
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(element.getName());
}
br.addElement(sb.toString());
br.addItem("NotFound Element");
br.addElement(deprecated);
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.
the class DfClassificationTop method throwClassificationGroupingMapReferenceNotFoundException.
protected void throwClassificationGroupingMapReferenceNotFoundException(List<DfClassificationGroup> groupList, DfClassificationGroup group, String refName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the refenrece in the grouping map.");
br.addItem("Classification Name");
br.addElement(group.getClassificationName());
br.addItem("Group Name");
br.addElement(group.getGroupName());
br.addItem("NotFound Name");
br.addElement(refName);
br.addItem("Defined Group");
for (DfClassificationGroup defined : groupList) {
br.addElement(defined);
}
final String msg = br.buildExceptionMessage();
throw new DfIllegalPropertySettingException(msg);
}
Aggregations