use of org.dbflute.twowaysql.node.IfNode in project dbflute-core by dbflute.
the class DfMailFluteTableLoader method processAutoDetect.
// -----------------------------------------------------
// AutoDetect
// ----------
protected void processAutoDetect(String fileText, Map<String, String> propertyNameTypeMap, Map<String, String> propertyNameOptionMap, Set<String> propertyNameSet) {
final DfParameterAutoDetectProcess process = new DfParameterAutoDetectProcess() {
@Override
protected DfParameterAutoDetectBindNode newParameterAutoDetectBindNode(DfParameterAutoDetectAssist assist) {
return super.newParameterAutoDetectBindNode(assist).unuseTestValue("String");
}
@Override
protected void processAlternateBooleanMethodIfNode(String sql, IfNode ifNode) {
// unsupported
}
};
process.processAutoDetect(fileText, propertyNameTypeMap, propertyNameOptionMap, propertyNameSet);
}
use of org.dbflute.twowaysql.node.IfNode in project dbflute-core by dbflute.
the class SqlAnalyzer method parseIf.
protected void parseIf() {
final String comment = _tokenizer.getToken();
final String condition = comment.substring(IfNode.PREFIX.length()).trim();
if (Srl.is_Null_or_TrimmedEmpty(condition)) {
throwIfCommentConditionEmptyException();
}
final IfNode ifNode = createIfNode(condition);
peek().addChild(ifNode);
push(ifNode);
parseEnd();
}
use of org.dbflute.twowaysql.node.IfNode in project dbflute-core by dbflute.
the class DfParameterAutoDetectProcess method doProcessAutoDetect.
protected void doProcessAutoDetect(String sql, Map<String, String> propertyNameTypeMap, Map<String, String> propertyNameOptionMap, Set<String> autoDetectedPropertyNameSet, Node node) {
// because simple specification is very important here
if (node instanceof BindVariableNode) {
final BindVariableNode bindNode = (BindVariableNode) node;
processAutoDetectBindNode(sql, propertyNameTypeMap, propertyNameOptionMap, autoDetectedPropertyNameSet, bindNode);
} else if (node instanceof IfNode) {
final IfNode ifNode = (IfNode) node;
processAutoDetectIfNode(sql, propertyNameTypeMap, propertyNameOptionMap, ifNode);
// process alternate boolean methods, supported with auto-detect
processAlternateBooleanMethodIfNode(sql, ifNode);
} else if (node instanceof ForNode) {
processAutoDetectForNode(sql, propertyNameTypeMap, propertyNameOptionMap, (ForNode) node);
}
for (int i = 0; i < node.getChildSize(); i++) {
final Node childNode = node.getChild(i);
// recursive call
doProcessAutoDetect(sql, propertyNameTypeMap, propertyNameOptionMap, autoDetectedPropertyNameSet, childNode);
}
}
use of org.dbflute.twowaysql.node.IfNode in project dbflute-core by dbflute.
the class DfPmFileTableLoader method processAutoDetect.
protected void processAutoDetect(String fileText, Map<String, String> propertyNameTypeMap, Map<String, String> propertyNameOptionMap, Set<String> propertyNameSet) {
final DfParameterAutoDetectProcess process = new DfParameterAutoDetectProcess() {
@Override
protected DfParameterAutoDetectBindNode newParameterAutoDetectBindNode(DfParameterAutoDetectAssist assist) {
return super.newParameterAutoDetectBindNode(assist).unuseTestValue("String");
}
@Override
protected void processAlternateBooleanMethodIfNode(String sql, IfNode ifNode) {
// unsupported
}
};
process.processAutoDetect(fileText, propertyNameTypeMap, propertyNameOptionMap, propertyNameSet);
}
use of org.dbflute.twowaysql.node.IfNode in project dbflute-core by dbflute.
the class SqlAnalyzer method parseElse.
// ===================================================================================
// ELSE Comment
// ============
protected void parseElse() {
final Node parent = peek();
if (!(parent instanceof IfNode)) {
return;
}
final IfNode ifNode = (IfNode) pop();
final ElseNode elseNode = createElseNode();
ifNode.setElseNode(elseNode);
push(elseNode);
_tokenizer.skipWhitespace();
}
Aggregations