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 Object
Represents a JMESPath AST node.
  • Constructor Details

    • JmespathExpression

      protected JmespathExpression(int line, int column)
  • Method Details

    • parse

      public static JmespathExpression parse(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.