Search in sources :

Example 1 with LoopVariableCommentOutOfForCommentException

use of org.dbflute.twowaysql.exception.LoopVariableCommentOutOfForCommentException in project dbflute-core by dbflute.

the class LoopAbstractNode method accept.

// ===================================================================================
// Accept
// ======
public void accept(CommandContext ctx) {
    final LoopVariableType type = getLoopVariableType();
    final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
    br.addNotice("The " + type.name() + " comment was out of FOR comment!");
    br.addItem("Advice");
    br.addElement("A " + type.name() + " comment should be in FOR comment scope.");
    br.addElement("For example:");
    br.addElement(" (x):");
    br.addElement("   /*" + type.name() + "*/.../*END*/");
    br.addElement("   /*FOR*/.../*END*/");
    br.addElement(" (o):");
    br.addElement("   /*FOR*/");
    br.addElement("   /*" + type.name() + "*/.../*END*/");
    br.addElement("   /*END*/");
    br.addItem(type.name() + " Comment Expression");
    br.addElement(_expression);
    br.addItem("Specified SQL");
    br.addElement(_specifiedSql);
    final String msg = br.buildExceptionMessage();
    throw new LoopVariableCommentOutOfForCommentException(msg);
}
Also used : LoopVariableCommentOutOfForCommentException(org.dbflute.twowaysql.exception.LoopVariableCommentOutOfForCommentException) ExceptionMessageBuilder(org.dbflute.helper.message.ExceptionMessageBuilder) LoopVariableType(org.dbflute.twowaysql.node.ForNode.LoopVariableType)

Aggregations

ExceptionMessageBuilder (org.dbflute.helper.message.ExceptionMessageBuilder)1 LoopVariableCommentOutOfForCommentException (org.dbflute.twowaysql.exception.LoopVariableCommentOutOfForCommentException)1 LoopVariableType (org.dbflute.twowaysql.node.ForNode.LoopVariableType)1