Search in sources :

Example 26 with DfIllegalPropertySettingException

use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.

the class DfRefClsLoadingHandler method throwAppClsReferredClsNotFoundException.

protected void throwAppClsReferredClsNotFoundException(String classificationName, String refAttr, String refClsTheme, String refClsName, Map<String, DfClassificationTop> clsTopMap, DfFreeGenResource resource) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found the referred classification from the app classification.");
    br.addItem("Advice");
    br.addElement("Make sure your classification name of refCls attribute.");
    br.addItem("AppCls");
    br.addElement(classificationName);
    br.addItem("RefCls Attribute");
    br.addElement(refAttr);
    br.addItem("RefCls Theme");
    br.addElement(refClsTheme);
    br.addItem("NotFound Cls");
    br.addElement(refClsName);
    br.addItem("Existing Cls");
    br.addElement(clsTopMap.keySet());
    br.addItem("dfprop File");
    br.addElement(resource.getResourceFile());
    final String msg = br.buildExceptionMessage();
    throw new DfIllegalPropertySettingException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfIllegalPropertySettingException(org.dbflute.exception.DfIllegalPropertySettingException)

Example 27 with DfIllegalPropertySettingException

use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.

the class DfRefClsLoadingHandler method throwAppClsReferredClsGroupNotFoundException.

protected void throwAppClsReferredClsGroupNotFoundException(String classificationName, String refAttr, String refClsTheme, String refClsName, String refGroupName, DfClassificationTop referredClsTop, DfFreeGenResource resource) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Not found the group of referred classification from the app classification.");
    br.addItem("Advice");
    br.addElement("Make sure your classification name of refCls attribute.");
    br.addItem("AppCls");
    br.addElement(classificationName);
    br.addItem("RefCls Attribute");
    br.addElement(refAttr);
    br.addItem("RefCls Theme");
    br.addElement(refClsTheme);
    br.addItem("Referred Cls");
    br.addElement(refClsName);
    br.addItem("NotFound Group");
    br.addElement(refGroupName);
    br.addItem("Existing Group");
    br.addElement(referredClsTop.getGroupList().stream().map(gr -> gr.getGroupName()).collect(Collectors.toList()));
    br.addItem("dfprop File");
    br.addElement(resource.getResourceFile());
    final String msg = br.buildExceptionMessage();
    throw new DfIllegalPropertySettingException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfIllegalPropertySettingException(org.dbflute.exception.DfIllegalPropertySettingException)

Example 28 with DfIllegalPropertySettingException

use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.

the class DfJsonFreeAgent method throwIllegalKeyPathElementException.

protected void throwIllegalKeyPathElementException(String requestName, DfFreeGenResource resource, String keyPath, String illegalPathElement) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("Illegal key path was found. (FreeGen)");
    br.addItem("Request Name");
    br.addElement(requestName);
    br.addItem("JSON File");
    br.addElement(resource.getResourceFile());
    br.addItem("keyPath");
    br.addElement(keyPath);
    br.addItem("Illegal Path Element");
    br.addElement(illegalPathElement);
    final String msg = br.buildExceptionMessage();
    throw new DfIllegalPropertySettingException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfIllegalPropertySettingException(org.dbflute.exception.DfIllegalPropertySettingException)

Example 29 with DfIllegalPropertySettingException

use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.

the class DfJsonFreeAgent method throwKeyPathExpectedListButNotListException.

protected void throwKeyPathExpectedListButNotListException(String requestName, DfFreeGenResource resource, String keyPath, String targetPath, Object current) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The key path expects list type but not list. (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);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfIllegalPropertySettingException(org.dbflute.exception.DfIllegalPropertySettingException)

Example 30 with DfIllegalPropertySettingException

use of org.dbflute.exception.DfIllegalPropertySettingException in project dbflute-core by dbflute.

the class DfJsonFreeAgent method throwJsonTracePathNotMapException.

protected void throwJsonTracePathNotMapException(String requestName, DfFreeGenResource resource, String tracePath, String pathElement, Object current) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The trace 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("Trace Path");
    br.addElement(tracePath);
    br.addItem("Path Element");
    br.addElement(pathElement);
    br.addItem("Actual Object");
    br.addElement(current != null ? current.getClass().getName() : null);
    br.addElement(current);
    final String msg = br.buildExceptionMessage();
    throw new DfIllegalPropertySettingException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfIllegalPropertySettingException(org.dbflute.exception.DfIllegalPropertySettingException)

Aggregations

DfIllegalPropertySettingException (org.dbflute.exception.DfIllegalPropertySettingException)76 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)58 Map (java.util.Map)9 DfClassificationTop (org.dbflute.properties.assistant.classification.DfClassificationTop)9 List (java.util.List)8 DfClassificationElement (org.dbflute.properties.assistant.classification.DfClassificationElement)8 LinkedHashMap (java.util.LinkedHashMap)6 ArrayList (java.util.ArrayList)5 StringKeyMap (org.dbflute.helper.StringKeyMap)4 DfClassificationGroup (org.dbflute.properties.assistant.classification.DfClassificationGroup)4 Collectors (java.util.stream.Collectors)3 ClassificationUndefinedHandlingType (org.dbflute.jdbc.ClassificationUndefinedHandlingType)3 DfRefClsElement (org.dbflute.properties.assistant.classification.DfRefClsElement)3 RichTextString (org.apache.poi.ss.usermodel.RichTextString)2 DfIllegalPropertyTypeException (org.dbflute.exception.DfIllegalPropertyTypeException)2 ScopeInfo (org.dbflute.util.Srl.ScopeInfo)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1