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.ObjectRepresents a JMESPath AST node.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJmespathExpression(int line, int column)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> Taccept(ExpressionVisitor<T> visitor)Visits a node using a double-dispatch visitor.intgetColumn()Get the approximate column where the node was defined.intgetLine()Get the approximate line where the node was defined.LinterResultlint()Lint the expression using static analysis using "any" as the current node.LinterResultlint(LiteralExpression currentNode)Lint the expression using static analysis.static JmespathExpressionparse(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.
-
-