public class Query extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Query.Range |
| Modifier and Type | Field and Description |
|---|---|
private AtomicBoolean |
evaluated |
private Evaluator<?> |
evaluator |
private String |
query |
private org.antlr.runtime.tree.Tree |
tree |
| Modifier | Constructor and Description |
|---|---|
private |
Query(String query,
org.antlr.runtime.tree.Tree tree,
Evaluator<?> evaluator) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
addLiteralsAndParameters(ParameterParser parser,
String input,
List<Expression> expressions,
boolean allowSensitiveParameterReference) |
static Query |
compile(String query) |
(package private) QueryResult<?> |
evaluate(EvaluationContext evaluationContext) |
(package private) static String |
evaluateExpression(org.antlr.runtime.tree.Tree tree,
Evaluator<?> rootEvaluator,
String queryText,
EvaluationContext evaluationContext,
AttributeValueDecorator decorator) |
(package private) static String |
evaluateExpressions(String rawValue,
Map<String,String> expressionMap,
AttributeValueDecorator decorator,
Map<String,String> stateVariables,
ParameterLookup parameterLookup) |
(package private) static String |
evaluateExpressions(String rawValue,
Map<String,String> valueLookup,
AttributeValueDecorator decorator,
ParameterLookup parameterLookup) |
(package private) static String |
evaluateExpressions(String rawValue,
Map<String,String> valueLookup,
ParameterLookup parameterLookup) |
static List<Query.Range> |
extractEscapedRanges(String value) |
static List<Query.Range> |
extractExpressionRanges(String value) |
private static List<Query.Range> |
extractExpressionRanges(String value,
boolean extractEscapeSequences) |
static List<String> |
extractExpressions(String value) |
static List<AttributeExpression.ResultType> |
extractResultTypes(String value) |
(package private) static int |
findEndQuoteChar(String value,
int quoteStart) |
static Query |
fromTree(org.antlr.runtime.tree.Tree tree,
String text) |
AttributeExpression.ResultType |
getResultType() |
static AttributeExpression.ResultType |
getResultType(String value) |
(package private) org.antlr.runtime.tree.Tree |
getTree() |
static boolean |
isValidExpression(String value) |
static PreparedQuery |
prepare(String query) |
private static PreparedQuery |
prepare(String rawQuery,
boolean escapeParameterReferences) |
static PreparedQuery |
prepareWithParametersPreEvaluated(String query) |
String |
toString() |
static String |
unescape(String value)
Un-escapes ${...} patterns that were escaped
|
private static String |
unescapeLeadingDollarSigns(String value) |
private static String |
unescapeTrailingDollarSigns(String value,
boolean escapeIfAllDollars) |
static void |
validateExpression(String value,
boolean allowSurroundingCharacters) |
private final String query
private final org.antlr.runtime.tree.Tree tree
private final Evaluator<?> evaluator
private final AtomicBoolean evaluated
public static boolean isValidExpression(String value)
public static AttributeExpression.ResultType getResultType(String value) throws AttributeExpressionLanguageParsingException
public static List<AttributeExpression.ResultType> extractResultTypes(String value) throws AttributeExpressionLanguageParsingException
public static List<String> extractExpressions(String value) throws AttributeExpressionLanguageParsingException
public static List<Query.Range> extractExpressionRanges(String value) throws AttributeExpressionLanguageParsingException
public static List<Query.Range> extractEscapedRanges(String value) throws AttributeExpressionLanguageParsingException
private static List<Query.Range> extractExpressionRanges(String value, boolean extractEscapeSequences) throws AttributeExpressionLanguageParsingException
public static void validateExpression(String value, boolean allowSurroundingCharacters) throws AttributeExpressionLanguageParsingException
value - expression to validateallowSurroundingCharacters - whether to allow surrounding charsAttributeExpressionLanguageParsingException - if problems parsing given expressionstatic int findEndQuoteChar(String value, int quoteStart)
static String evaluateExpression(org.antlr.runtime.tree.Tree tree, Evaluator<?> rootEvaluator, String queryText, EvaluationContext evaluationContext, AttributeValueDecorator decorator) throws ProcessException
ProcessExceptionstatic String evaluateExpressions(String rawValue, Map<String,String> expressionMap, AttributeValueDecorator decorator, Map<String,String> stateVariables, ParameterLookup parameterLookup) throws ProcessException
ProcessExceptionstatic String evaluateExpressions(String rawValue, Map<String,String> valueLookup, ParameterLookup parameterLookup) throws ProcessException
ProcessExceptionstatic String evaluateExpressions(String rawValue, Map<String,String> valueLookup, AttributeValueDecorator decorator, ParameterLookup parameterLookup) throws ProcessException
ProcessExceptionpublic static String unescape(String value)
value - to un-escapeprivate static String unescapeTrailingDollarSigns(String value, boolean escapeIfAllDollars)
public static PreparedQuery prepareWithParametersPreEvaluated(String query) throws AttributeExpressionLanguageParsingException
public static PreparedQuery prepare(String query) throws AttributeExpressionLanguageParsingException
private static PreparedQuery prepare(String rawQuery, boolean escapeParameterReferences) throws AttributeExpressionLanguageParsingException
private static void addLiteralsAndParameters(ParameterParser parser, String input, List<Expression> expressions, boolean allowSensitiveParameterReference)
public static Query compile(String query) throws AttributeExpressionLanguageParsingException
public AttributeExpression.ResultType getResultType()
QueryResult<?> evaluate(EvaluationContext evaluationContext)
org.antlr.runtime.tree.Tree getTree()
Copyright © 2022 Apache NiFi Project. All rights reserved.