use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.
the class ForeignKey method extractFixedConditionEmbeddedCommentClassification.
// -----------------------------------------------------
// EmbeddedComment Classification
// ------------------------------
protected String extractFixedConditionEmbeddedCommentClassification(String peace, String parameterType) {
// parameterType is e.g. MemberStatus.Formalized
if (!parameterType.contains(".")) {
String msg = "The classification expression should be 'classificationName.elementName':";
msg = msg + " expression=" + parameterType + " embeddedComment=" + peace;
throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
// e.g. MemberStatus
final String classificationName = parameterType.substring(0, parameterType.indexOf("."));
// e.g. Formalized
final String elementName = parameterType.substring(parameterType.indexOf(".") + ".".length());
final Map<String, DfClassificationTop> topMap = getClassificationProperties().getClassificationTopMap();
final DfClassificationTop classificationTop = topMap.get(classificationName);
if (classificationTop == null) {
throwFixedConditionEmbeddedCommentClassificationNotFoundException(classificationName);
}
String code = doExtractFixedConditionEmbeddedCommentClassificationNormalCode(classificationTop, elementName);
if (code != null) {
return code;
}
// may be group here
code = doExtractFixedConditionEmbeddedCommentClassificationGroupCode(classificationTop, elementName);
if (code != null) {
return code;
}
throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(classificationTop, elementName);
// unreachable
return null;
}
use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.
the class DfFixedConditionDynamicAnalyzer method extractEmbeddedCommentClassification.
// ===================================================================================
// EmbeddedComment Classification
// ==============================
protected String extractEmbeddedCommentClassification(String peace, String parameterType) {
// parameterType is e.g. MemberStatus.Formalized
if (!parameterType.contains(".")) {
String msg = "The classification expression should be 'classificationName.elementName':";
msg = msg + " expression=" + parameterType + " embeddedComment=" + peace;
throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
// e.g. MemberStatus
final String classificationName = parameterType.substring(0, parameterType.indexOf("."));
// e.g. Formalized
final String elementName = parameterType.substring(parameterType.indexOf(".") + ".".length());
final Map<String, DfClassificationTop> topMap = getClassificationProperties().getClassificationTopMap();
final DfClassificationTop classificationTop = topMap.get(classificationName);
if (classificationTop == null) {
throwFixedConditionEmbeddedCommentClassificationNotFoundException(classificationName);
}
String code = doExtractEmbeddedCommentClassificationNormalCode(classificationTop, elementName);
if (code != null) {
return code;
}
// may be group here
code = doExtractEmbeddedCommentClassificationGroupCode(classificationTop, elementName);
if (code != null) {
return code;
}
throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(classificationTop, elementName);
// unreachable
return null;
}
use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.
the class ForeignKey method throwFixedConditionEmbeddedCommentClassificationNotFoundException.
protected void throwFixedConditionEmbeddedCommentClassificationNotFoundException(String classificationName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the classification in fixed condition.");
br.addItem("Foreign Key");
br.addElement(_name);
br.addItem("NotFound Classification");
br.addElement(classificationName);
final String msg = br.buildExceptionMessage();
throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.
the class ForeignKey method throwFixedConditionEmbeddedCommentClassificationElementNotFoundException.
protected void throwFixedConditionEmbeddedCommentClassificationElementNotFoundException(DfClassificationTop classificationTop, String elementName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the classification element in fixed condition.");
br.addItem("Foreign Key");
br.addElement(_name);
br.addItem("Classification Name");
br.addElement(classificationTop.getClassificationName());
br.addItem("NotFound Element");
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 DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
use of org.dbflute.exception.DfFixedConditionInvalidClassificationEmbeddedCommentException in project dbflute-core by dbflute.
the class DfFixedConditionDynamicAnalyzer method throwFixedConditionEmbeddedCommentClassificationNotFoundException.
protected void throwFixedConditionEmbeddedCommentClassificationNotFoundException(String classificationName) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("Not found the classification in fixed condition.");
br.addItem("Foreign Key");
br.addElement(_foreignKey.getName());
br.addItem("NotFound Classification");
br.addElement(classificationName);
final String msg = br.buildExceptionMessage();
throw new DfFixedConditionInvalidClassificationEmbeddedCommentException(msg);
}
Aggregations