Skip to content

Finding Types

Jon Schneider edited this page Nov 28, 2016 · 1 revision

You can locate the use of types anywhere in source code (excluding imports) with:

Tr.CompilationUnit cu = parser.parse(a)
List<NameTree> cu.refactor().findType("java.util.List");

Specifically, this finds types in:

  1. Annotations
  2. Array types
  3. Class declarations - in extends and implements clauses
  4. Method declarations - in return types and throws clauses
  5. Method invocations - in static method targets and type parameters
  6. Multi-catch statements
  7. Variable and multi-variable declarations
  8. New arrays
  9. New classes
  10. Parameterized types
  11. Type casts
  12. Bounded wildcards
Clone this wiki locally