コード例 #1
0
  /**
   * Checks if the given TypeReference node is likely to be a reference to the provided class.
   *
   * @param type An actual type. This method checks if {@code typeNode} is likely to be a reference
   *     to this type.
   * @param node A Lombok AST node. Any node in the appropriate compilation unit will do (used to
   *     get access to import statements).
   * @param typeNode A type reference to check.
   */
  public static boolean typeMatches(Class<?> type, JavacNode node, JCTree typeNode) {
    String typeName = typeNode.toString();

    TypeResolver resolver = new TypeResolver(node.getImportList());
    return resolver.typeMatches(node, type.getName(), typeName);
  }