org.eclipse.jdt.core.manipulation

## Class ImportReferencesCollector

- java.lang.Object
- - org.eclipse.jdt.core.dom.ASTVisitor
  - - org.eclipse.jdt.internal.corext.dom.GenericVisitor
    - - org.eclipse.jdt.core.manipulation.ImportReferencesCollector

    public class ImportReferencesCollector
    extends org.eclipse.jdt.internal.corext.dom.GenericVisitor

Since:
  1.10

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static void` `collect(ASTNode node, IJavaProject project, Region rangeLimit, boolean skipMethodBodies, Collection<SimpleName> resultingTypeImports, Collection<SimpleName> resultingStaticImports)` Collect import statements from an AST node.
`static void` `collect(ASTNode node, IJavaProject project, Region rangeLimit, Collection<SimpleName> resultingTypeImports, Collection<SimpleName> resultingStaticImports)` Collect import statements from an AST node.
`boolean` `visit(BreakStatement node)` Visits the given type-specific AST node.
`boolean` `visit(ClassInstanceCreation node)` Visits the given type-specific AST node.
`boolean` `visit(ContinueStatement node)` Visits the given type-specific AST node.
`boolean` `visit(CreationReference node)` Visits the given type-specific AST node.
`boolean` `visit(ExpressionMethodReference node)` Visits the given type-specific AST node.
`boolean` `visit(FieldAccess node)` Visits the given type-specific AST node.
`boolean` `visit(ImportDeclaration node)` Visits the given type-specific AST node.
`boolean` `visit(LabeledStatement node)` Visits the given type-specific AST node.
`boolean` `visit(MarkerAnnotation node)` Visits the given type-specific AST node.
`boolean` `visit(MemberRef node)` Visits the given type-specific AST node.
`boolean` `visit(MethodDeclaration node)` Visits the given type-specific AST node.
`boolean` `visit(MethodInvocation node)` Visits the given type-specific AST node.
`boolean` `visit(MethodRef node)` Visits the given type-specific AST node.
`boolean` `visit(MethodRefParameter node)` Visits the given type-specific AST node.
`boolean` `visit(NameQualifiedType node)` Visits the given type-specific AST node.
`boolean` `visit(NormalAnnotation node)` Visits the given type-specific AST node.
`boolean` `visit(PackageDeclaration node)` Visits the given type-specific AST node.
`boolean` `visit(ProvidesDirective node)` Visits the given type-specific AST node.
`boolean` `visit(QualifiedName node)` Visits the given type-specific AST node.
`boolean` `visit(QualifiedType node)` Visits the given type-specific AST node.
`boolean` `visit(SimpleName node)` Visits the given type-specific AST node.
`boolean` `visit(SimpleType node)` Visits the given type-specific AST node.
`boolean` `visit(SingleMemberAnnotation node)` Visits the given type-specific AST node.
`boolean` `visit(SuperConstructorInvocation node)` Visits the given type-specific AST node.
`boolean` `visit(SuperFieldAccess node)` Visits the given type-specific AST node.
`boolean` `visit(SuperMethodReference node)` Visits the given type-specific AST node.
`boolean` `visit(TagElement node)` Visits the given type-specific AST node.
`boolean` `visit(ThisExpression node)` Visits the given type-specific AST node.
`boolean` `visit(TypeDeclaration node)` Visits the given type-specific AST node.
`boolean` `visit(TypeMethodReference node)` Visits the given type-specific AST node.
`boolean` `visit(UsesDirective node)` Visits the given type-specific AST node.
`protected boolean` `visitNode(ASTNode node)`

### Methods inherited from class org.eclipse.jdt.internal.corext.dom.GenericVisitor

`endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisit, endVisitNode, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit`

### Methods inherited from class org.eclipse.jdt.core.dom.ASTVisitor

`postVisit, preVisit, preVisit2`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### collect

    public static void collect(ASTNode node,
                               IJavaProject project,
                               Region rangeLimit,
                               Collection<SimpleName> resultingTypeImports,
                               Collection<SimpleName> resultingStaticImports)

Collect import statements from an AST node.

Parameters:
  `node` - The AST node
  `project` - The Java project
  `rangeLimit` - The range within the source file
  `resultingTypeImports` - The collected import references
  `resultingStaticImports` - The collected static imports

#### collect

    public static void collect(ASTNode node,
                               IJavaProject project,
                               Region rangeLimit,
                               boolean skipMethodBodies,
                               Collection<SimpleName> resultingTypeImports,
                               Collection<SimpleName> resultingStaticImports)

Collect import statements from an AST node.

Parameters:
  `node` - The AST node
  `project` - The Java project
  `rangeLimit` - The range within the source file
  `skipMethodBodies` - If set, do not visit method bodies
  `resultingTypeImports` - The collected import references
  `resultingStaticImports` - The collected static imports

#### visitNode

    protected boolean visitNode(ASTNode node)

Overrides:
  `visitNode` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`

#### visit

    public boolean visit(SimpleType node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(NameQualifiedType node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(QualifiedType node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(QualifiedName node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ImportDeclaration node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(PackageDeclaration node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(LabeledStatement node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ContinueStatement node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(BreakStatement node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ThisExpression node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(SuperFieldAccess node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ClassInstanceCreation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MethodInvocation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(CreationReference node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may re-implement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ExpressionMethodReference node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may re-implement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(SuperMethodReference node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(TypeMethodReference node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(UsesDirective node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may re-implement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(ProvidesDirective node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may re-implement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(SuperConstructorInvocation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(FieldAccess node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(SimpleName node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MarkerAnnotation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(NormalAnnotation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(SingleMemberAnnotation node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(TypeDeclaration node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MethodDeclaration node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(TagElement node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MemberRef node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MethodRef node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped

#### visit

    public boolean visit(MethodRefParameter node)

Description copied from class: `ASTVisitor`
Visits the given type-specific AST node.

The default implementation does nothing and return true. Subclasses may reimplement.

Overrides:
  `visit` in class `org.eclipse.jdt.internal.corext.dom.GenericVisitor`
Parameters:
  `node` - the node to visit
Returns:
  `true` if the children of this node should be visited, and `false` if the children of this node should be skipped