use of com.abubusoft.kripton.processor.sqlite.grammars.jsql.JqlParser.Bind_parameterContext in project kripton by xcesco.
the class JQLChecker method extractPlaceHolders.
private <L extends Collection<JQLPlaceHolder>> L extractPlaceHolders(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
valid.value0 = false;
analyzeInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContext ctx) {
String value;
if (ctx.bind_parameter_name() != null) {
value = ctx.bind_parameter_name().getText();
} else {
value = ctx.getText();
}
result.add(new JQLPlaceHolder(JQLPlaceHolderType.PARAMETER, value));
}
@Override
public void enterBind_dynamic_sql(Bind_dynamic_sqlContext ctx) {
result.add(new JQLPlaceHolder(JQLPlaceHolderType.DYNAMIC_SQL, ctx.bind_parameter_name().getText()));
}
});
return result;
}
use of com.abubusoft.kripton.processor.sqlite.grammars.jsql.JqlParser.Bind_parameterContext in project kripton by xcesco.
the class JQLChecker method extractPlaceHoldersFromVariableStatement.
private <L extends Collection<JQLPlaceHolder>> L extractPlaceHoldersFromVariableStatement(final JQLContext jqlContext, String jql, final L result) {
final One<Boolean> valid = new One<>();
if (!StringUtils.hasText(jql))
return result;
valid.value0 = false;
analyzeVariableStatementInternal(jqlContext, jql, new JqlBaseListener() {
@Override
public void enterBind_parameter(Bind_parameterContext ctx) {
String parameter;
if (ctx.bind_parameter_name() != null) {
parameter = ctx.bind_parameter_name().getText();
} else {
parameter = ctx.getText();
}
result.add(new JQLPlaceHolder(JQLPlaceHolderType.PARAMETER, parameter));
}
@Override
public void enterBind_dynamic_sql(Bind_dynamic_sqlContext ctx) {
result.add(new JQLPlaceHolder(JQLPlaceHolderType.DYNAMIC_SQL, ctx.bind_parameter_name().getText()));
}
});
return result;
}
Aggregations