Search in sources :

Example 6 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClsElementLiteralArranger method throwClassificationLiteralCodeNotFoundException.

protected void throwClassificationLiteralCodeNotFoundException(String classificationName, Map<?, ?> elementMap) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The code attribute of the classification was not found.");
    br.addItem("Advice");
    br.addElement("The classification should have the code attribute.");
    br.addElement("See the document for the DBFlute property.");
    br.addItem("Classification");
    br.addElement(classificationName);
    br.addItem("Element Map");
    br.addElement(elementMap);
    final String msg = br.buildExceptionMessage();
    throw new DfClassificationRequiredAttributeNotFoundException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfClassificationRequiredAttributeNotFoundException(org.dbflute.exception.DfClassificationRequiredAttributeNotFoundException) MapListString(org.dbflute.helper.mapstring.MapListString)

Example 7 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClsElementBasicItemAcceptor method throwClassificationRequiredAttributeNotFoundException.

protected void throwClassificationRequiredAttributeNotFoundException() {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The element map did not have a 'code' attribute.");
    br.addItem("Advice");
    br.addElement("An element map requires 'code' attribute like this:");
    br.addElement("  (o): map:{table=MEMBER_STATUS; code=MEMBER_STATUS_CODE; ...}");
    br.addItem("Classification");
    br.addElement(_classificationName);
    if (_table != null) {
        br.addItem("Table");
        br.addElement(_table);
    }
    br.addItem("ElementMap");
    br.addElement(_elementMap);
    final String msg = br.buildExceptionMessage();
    throw new DfClassificationRequiredAttributeNotFoundException(msg);
}
Also used : ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) DfClassificationRequiredAttributeNotFoundException(org.dbflute.exception.DfClassificationRequiredAttributeNotFoundException)

Aggregations

DfClassificationRequiredAttributeNotFoundException (org.dbflute.exception.DfClassificationRequiredAttributeNotFoundException)7 ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)6 MapListString (org.dbflute.helper.mapstring.MapListString)2 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 Map (java.util.Map)1 DfClassificationGroup (org.dbflute.properties.assistant.classification.DfClassificationGroup)1