Search in sources :

Example 1 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClassificationElement method throwClassificationRequiredAttributeNotFoundException.

protected void throwClassificationRequiredAttributeNotFoundException(Map<?, ?> elementMap) {
    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)

Example 2 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClassificationLiteralArranger 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 3 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClassificationTop method throwClassificationLiteralCommentNotFoundException.

protected void throwClassificationLiteralCommentNotFoundException(String classificationName, Map<?, ?> elementMap) {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The comment attribute of the classification was not found.");
    br.addItem("Advice");
    br.addElement("The classification should have the comment 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)

Example 4 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClsTopGroupListArranger method arrangeGroupList.

// ===================================================================================
// Group List
// ==========
public List<DfClassificationGroup> arrangeGroupList() {
    final List<DfClassificationGroup> groupList = new ArrayList<DfClassificationGroup>();
    for (Entry<String, Map<String, Object>> entry : _groupingMap.entrySet()) {
        final String groupName = entry.getKey();
        final Map<String, Object> attrMap = entry.getValue();
        // #for_now jflute not required for a long time but required better? (2021/07/05)
        final String groupComment = (String) attrMap.get(KEY_GROUP_COMMENT);
        @SuppressWarnings("unchecked") final List<String> elementList = (List<String>) attrMap.get(KEY_ELEMENT_LIST);
        if (elementList == null) {
            String msg = "The elementList in grouping map is required: " + _classificationTop.getClassificationName();
            throw new DfClassificationRequiredAttributeNotFoundException(msg);
        }
        final String docOnly = (String) attrMap.get(KEY_USE_DOCUMENT_ONLY);
        final DfClassificationGroup group = new DfClassificationGroup(_classificationTop, groupName);
        group.setGroupComment(groupComment);
        group.setElementNameList(elementList);
        group.setUseDocumentOnly(docOnly != null && docOnly.trim().equalsIgnoreCase("true"));
        groupList.add(group);
    }
    resolveGroupVariable(groupList);
    return filterTaskMatchingList(groupList);
}
Also used : DfClassificationGroup(org.dbflute.properties.assistant.classification.DfClassificationGroup) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) DfClassificationRequiredAttributeNotFoundException(org.dbflute.exception.DfClassificationRequiredAttributeNotFoundException) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 5 with DfClassificationRequiredAttributeNotFoundException

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

the class DfClsTopBasicItemAcceptor method throwClassificationLiteralCommentNotFoundException.

protected void throwClassificationLiteralCommentNotFoundException() {
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The required topComment value is empty.");
    br.addItem("Advice");
    br.addElement("The classification should have the topComment value.");
    br.addElement("For example:");
    br.addElement("  (x): topComment= // *Bad: empty");
    br.addElement("  (o): topComment=sea is blue... // Good");
    br.addElement("");
    br.addElement("See the document for the DBFlute property.");
    br.addItem("Classification");
    br.addElement(_classificationName);
    br.addItem("Top Element Map");
    br.addElement(_topElementMap);
    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