/** * Find all nodes connected to the given binding. e.g. Declaration of a field and all references. * For types this includes also the constructor declaration, for methods also overridden methods * or methods overriding (if existing in the same AST) * @param root The root of the AST tree to search * @param binding The binding of the searched nodes * @return Return */ public static SimpleName[] findByBinding(ASTNode root, IBinding binding) { ArrayList<SimpleName> res= new ArrayList<>(); BindingFinder nodeFinder= new BindingFinder(binding, res); root.accept(nodeFinder); return res.toArray(new SimpleName[res.size()]); }
/** * Find all nodes connected to the given binding. e.g. Declaration of a field and all references. * For types this includes also the constructor declaration, for methods also overridden methods * or methods overriding (if existing in the same AST) * @param root The root of the AST tree to search * @param binding The binding of the searched nodes * @return Return */ public static SimpleName[] findByBinding(ASTNode root, IBinding binding) { ArrayList res= new ArrayList(); BindingFinder nodeFinder= new BindingFinder(binding, res); root.accept(nodeFinder); return (SimpleName[]) res.toArray(new SimpleName[res.size()]); }
/** * Find all nodes connected to the given binding. e.g. Declaration of a field and all references. * For types this includes also the constructor declaration, for methods also overridden methods * or methods overriding (if existing in the same AST) * @param root The root of the AST tree to search * @param binding The binding of the searched nodes * @return Return */ public static SimpleName[] findByBinding(ASTNode root, IBinding binding) { ArrayList<SimpleName> res= new ArrayList<>(); BindingFinder nodeFinder= new BindingFinder(binding, res); root.accept(nodeFinder); return res.toArray(new SimpleName[res.size()]); }