use of org.seasar.doma.internal.jdbc.sql.node.ElseifNode in project doma by domaframework.
the class NodePreparedSqlBuilder method handleElseifNode.
protected boolean handleElseifNode(IfBlockNode node, Context p) {
for (ElseifNode elseifNode : node.getElseifNodes()) {
SqlLocation location = elseifNode.getLocation();
String expression = elseifNode.getExpression();
EvaluationResult elseifResult = p.evaluate(location, expression);
if (elseifResult.getBooleanValue()) {
elseifNode.accept(this, p);
return true;
}
}
return false;
}
use of org.seasar.doma.internal.jdbc.sql.node.ElseifNode in project doma by domaframework.
the class SqlParser method parseElseifBlockComment.
protected void parseElseifBlockComment() {
if (!isInIfBlockNode()) {
throw new JdbcException(Message.DOMA2138, sql, tokenizer.getLineNumber(), tokenizer.getPosition());
}
removeNodesTo(IfBlockNode.class);
IfBlockNode ifBlockNode = peek();
if (ifBlockNode.isElseNodeExistent()) {
throw new JdbcException(Message.DOMA2139, sql, tokenizer.getLineNumber(), tokenizer.getPosition());
}
String expression = tokenType.extract(token);
ElseifNode node = new ElseifNode(getLocation(), expression, token);
ifBlockNode.addElseifNode(node);
push(node);
}
Aggregations