Class ASTExpectations

java.lang.Object
io.codemodder.javaparser.ASTExpectations

public final class ASTExpectations extends Object
A utility for validating the shape of ASTs and filtering them to retrieve. It only exposes one endpoint, expect(Node), which allows folks to filter and telescope a further down an AST subgraph.

The notable weakness of this API is use cases where you need to retrieve multiple parts of the AST, but we have not run into that much as of yet.

  • Method Details

    • expect

      public static ASTExpectations.NodeExpectation expect(com.github.javaparser.ast.Node node)
      The starting point for validating the shape of an AST and returning a subgraph.