Package software.amazon.smithy.jmespath
Class JmespathExpression
- java.lang.Object
-
- software.amazon.smithy.jmespath.JmespathExpression
-
- Direct Known Subclasses:
BinaryExpression
,CurrentExpression
,ExpressionTypeExpression
,FieldExpression
,FlattenExpression
,FunctionExpression
,IndexExpression
,LiteralExpression
,MultiSelectHashExpression
,MultiSelectListExpression
,NotExpression
,SliceExpression
public abstract class JmespathExpression extends java.lang.Object
Represents a JMESPath AST node.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JmespathExpression(int line, int column)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> T
accept(ExpressionVisitor<T> visitor)
Visits a node using a double-dispatch visitor.int
getColumn()
Get the approximate column where the node was defined.int
getLine()
Get the approximate line where the node was defined.LinterResult
lint()
Lint the expression using static analysis using "any" as the current node.LinterResult
lint(LiteralExpression currentNode)
Lint the expression using static analysis.static JmespathExpression
parse(java.lang.String text)
Parse a JMESPath expression.
-
-
-
Method Detail
-
parse
public static JmespathExpression parse(java.lang.String text)
Parse a JMESPath expression.- Parameters:
text
- Expression to parse.- Returns:
- Returns the parsed expression.
- Throws:
JmespathException
- if the expression is invalid.
-
getLine
public final int getLine()
Get the approximate line where the node was defined.- Returns:
- Returns the line.
-
getColumn
public final int getColumn()
Get the approximate column where the node was defined.- Returns:
- Returns the column.
-
accept
public abstract <T> T accept(ExpressionVisitor<T> visitor)
Visits a node using a double-dispatch visitor.- Type Parameters:
T
- Type of value the visitor returns.- Parameters:
visitor
- Visitor to accept on the node.- Returns:
- Returns the result of applying the visitor.
-
lint
public LinterResult lint()
Lint the expression using static analysis using "any" as the current node.- Returns:
- Returns the linter result.
-
lint
public LinterResult lint(LiteralExpression currentNode)
Lint the expression using static analysis.- Parameters:
currentNode
- The value to set as the current node.- Returns:
- Returns the problems that were detected.
-
-