Package org.apache.nifi.expression
Interface ExpressionLanguageCompiler
public interface ExpressionLanguageCompiler
-
Method Summary
Modifier and TypeMethodDescriptionCompiles the given Attribute Expression string into an AttributeExpression that can be evaluatedgetResultType
(String expression) Returns the ResultType that will be returned by the given Expressionboolean
isValidExpression
(String expression) Indicates whether or not the given string is a valid Attribute Expression.validateExpression
(String expression, boolean allowSurroundingCharacters) Attempts to validate the given expression and returnsnull
if the expression is syntactically valid or a String indicating why the expression is invalid otherwise.
-
Method Details
-
compile
Compiles the given Attribute Expression string into an AttributeExpression that can be evaluated- Parameters:
expression
- the Attribute Expression to be compiled- Returns:
- expression that can be evaluated
- Throws:
IllegalArgumentException
- if the given expression is not valid
-
isValidExpression
Indicates whether or not the given string is a valid Attribute Expression.- Parameters:
expression
- to validate- Returns:
- if is value or not
-
validateExpression
Attempts to validate the given expression and returnsnull
if the expression is syntactically valid or a String indicating why the expression is invalid otherwise.- Parameters:
expression
- to validateallowSurroundingCharacters
- iftrue
allows characters to surround the Expression, otherwise the expression must be exactly equal to a valid Expression. E.g.,/${path}
is valid if and only ifallowSurroundingCharacters
is true- Returns:
- a String indicating the reason that the expression is not
syntactically correct, or
null
if the expression is syntactically correct
-
getResultType
Returns the ResultType that will be returned by the given Expression- Parameters:
expression
- the Expression to evaluate- Returns:
- result type for the given expression
- Throws:
IllegalArgumentException
- if the given Expression is not a valid Expression Language Expression; the message of this Exception will indicate the problem if the expression is not syntactically valid.
-