public class JQLChecker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JQLChecker.JQLParameterName |
class |
JQLChecker.JQLRewriterListener |
| Modifier and Type | Field and Description |
|---|---|
protected static JQLChecker |
instance |
| Modifier and Type | Method and Description |
|---|---|
<L extends JqlBaseListener> |
analyze(JQLContext jqlContext,
JQL jql,
L listener) |
protected <L extends JqlBaseListener> |
analyzeInternal(JQLContext jqlContext,
String jql,
L listener) |
protected <L extends JqlBaseListener> |
analyzeVariableStatementInternal(JQLContext jqlContext,
String jql,
L listener) |
Set<String> |
extractColumnsToInsertOrUpdate(JQLContext jqlContext,
String jqlValue,
Finder<SQLProperty> entity) |
List<JQLPlaceHolder> |
extractFromVariableStatement(JQLContext jqlContext,
String jql)
Extract all bind parameters and dynamic part used in query.
|
List<JQLPlaceHolder> |
extractPlaceHoldersAsList(JQLContext jqlContext,
String jql)
Extract all bind parameters and dynamic part used in query.
|
Set<JQLPlaceHolder> |
extractPlaceHoldersAsSet(JQLContext jqlContext,
String jql)
Extract all bind parameters and dynamic part used in query.
|
Set<JQLPlaceHolder> |
extractPlaceHoldersFromVariableStatementAsSet(JQLContext jqlContext,
String jql)
Extract all bind parameters and dynamic part used in query.
|
Set<JQLProjection> |
extractProjections(JQLContext jqlContext,
String jqlValue,
Finder<SQLProperty> entity)
Retrieve set of projected field.
|
static JQLChecker |
getInstance() |
protected com.abubusoft.kripton.common.Pair<org.antlr.v4.runtime.ParserRuleContext,org.antlr.v4.runtime.CommonTokenStream> |
prepareParser(JQLContext jqlContext,
String jql) |
protected com.abubusoft.kripton.common.Pair<org.antlr.v4.runtime.ParserRuleContext,org.antlr.v4.runtime.CommonTokenStream> |
prepareVariableStatement(JQLContext jqlContext,
String jql)
Parse the variable parts of a SQL:
|
String |
replace(JQLContext jqlContext,
JQL jql,
JQLReplacerListener listener)
Replace place holder with element passed by listener
|
String |
replace(JQLContext jqlContext,
String jql,
JQLReplacerListener listener)
Replace place holder with element passed by listener
|
String |
replaceFromVariableStatement(JQLContext context,
String jql,
JQLReplacerListener listener)
Replace place holder with element passed by listener
|
String |
replaceVariableStatements(JQLContext jqlContext,
String jql,
JQLReplaceVariableStatementListener listener)
Given a sql, replace som component like where, order by, etc..
|
void |
verify(JQLContext jqlContext,
JQL jql)
Verify sql is syntactally correct, otherwise a KriptonProcessorException
will be thrown.
|
protected static JQLChecker instance
public static final JQLChecker getInstance()
protected <L extends JqlBaseListener> void analyzeInternal(JQLContext jqlContext, String jql, L listener)
protected <L extends JqlBaseListener> void analyzeVariableStatementInternal(JQLContext jqlContext, String jql, L listener)
public <L extends JqlBaseListener> void analyze(JQLContext jqlContext, JQL jql, L listener)
protected com.abubusoft.kripton.common.Pair<org.antlr.v4.runtime.ParserRuleContext,org.antlr.v4.runtime.CommonTokenStream> prepareParser(JQLContext jqlContext, String jql)
protected com.abubusoft.kripton.common.Pair<org.antlr.v4.runtime.ParserRuleContext,org.antlr.v4.runtime.CommonTokenStream> prepareVariableStatement(JQLContext jqlContext, String jql)
Parse the variable parts of a SQL:
jql - public Set<JQLProjection> extractProjections(JQLContext jqlContext, String jqlValue, Finder<SQLProperty> entity)
jql - public Set<String> extractColumnsToInsertOrUpdate(JQLContext jqlContext, String jqlValue, Finder<SQLProperty> entity)
public String replaceFromVariableStatement(JQLContext context, String jql, JQLReplacerListener listener)
jql - listener - public String replace(JQLContext jqlContext, JQL jql, JQLReplacerListener listener)
jql - listener - public String replace(JQLContext jqlContext, String jql, JQLReplacerListener listener)
jql - stringlistener - public void verify(JQLContext jqlContext, JQL jql)
Verify sql is syntactally correct, otherwise a KriptonProcessorException will be thrown.
sql - public List<JQLPlaceHolder> extractPlaceHoldersAsList(JQLContext jqlContext, String jql)
jql - public Set<JQLPlaceHolder> extractPlaceHoldersAsSet(JQLContext jqlContext, String jql)
jql - public Set<JQLPlaceHolder> extractPlaceHoldersFromVariableStatementAsSet(JQLContext jqlContext, String jql)
jql - public List<JQLPlaceHolder> extractFromVariableStatement(JQLContext jqlContext, String jql)
jql - public String replaceVariableStatements(JQLContext jqlContext, String jql, JQLReplaceVariableStatementListener listener)
Given a sql, replace som component like where, order by, etc..
Note that only first level of variable statements will be replaced.
jql - listener - Copyright © 2017. All rights reserved.