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 Modifier and Type Method Description static voidcollect(ASTNode node, IJavaProject project, Region rangeLimit, boolean skipMethodBodies, Collection<SimpleName> resultingTypeImports, Collection<SimpleName> resultingStaticImports)Collect import statements from an AST node.static voidcollect(ASTNode node, IJavaProject project, Region rangeLimit, Collection<SimpleName> resultingTypeImports, Collection<SimpleName> resultingStaticImports)Collect import statements from an AST node.booleanvisit(ClassInstanceCreation node)Visits the given type-specific AST node.booleanvisit(ContinueStatement node)Visits the given type-specific AST node.booleanvisit(CreationReference node)Visits the given type-specific AST node.booleanvisit(ExpressionMethodReference node)Visits the given type-specific AST node.booleanvisit(FieldAccess node)Visits the given type-specific AST node.booleanvisit(ImportDeclaration node)Visits the given type-specific AST node.booleanvisit(LabeledStatement node)Visits the given type-specific AST node.booleanvisit(MarkerAnnotation node)Visits the given type-specific AST node.booleanvisit(MemberRef node)Visits the given type-specific AST node.booleanvisit(MethodDeclaration node)Visits the given type-specific AST node.booleanvisit(MethodInvocation node)Visits the given type-specific AST node.booleanvisit(MethodRef node)Visits the given type-specific AST node.booleanvisit(MethodRefParameter node)Visits the given type-specific AST node.booleanvisit(NameQualifiedType node)Visits the given type-specific AST node.booleanvisit(NormalAnnotation node)Visits the given type-specific AST node.booleanvisit(PackageDeclaration node)Visits the given type-specific AST node.booleanvisit(ProvidesDirective node)Visits the given type-specific AST node.booleanvisit(QualifiedName node)Visits the given type-specific AST node.booleanvisit(QualifiedType node)Visits the given type-specific AST node.booleanvisit(SimpleName node)Visits the given type-specific AST node.booleanvisit(SimpleType node)Visits the given type-specific AST node.booleanvisit(SingleMemberAnnotation node)Visits the given type-specific AST node.booleanvisit(SuperConstructorInvocation node)Visits the given type-specific AST node.booleanvisit(SuperFieldAccess node)Visits the given type-specific AST node.booleanvisit(SuperMethodReference node)Visits the given type-specific AST node.booleanvisit(TagElement node)Visits the given type-specific AST node.booleanvisit(ThisExpression node)Visits the given type-specific AST node.booleanvisit(TypeDeclaration node)Visits the given type-specific AST node.booleanvisit(TypeMethodReference node)Visits the given type-specific AST node.booleanvisit(UsesDirective node)Visits the given type-specific AST node.booleanvisit(YieldStatement node)Visits the given type-specific AST node.protected booleanvisitNode(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, 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, visit, visit, visit, visit
-
Methods inherited from class org.eclipse.jdt.core.dom.ASTVisitor
postVisit, preVisit, preVisit2
-
-
-
-
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 nodeproject- The Java projectrangeLimit- The range within the source fileresultingTypeImports- The collected import referencesresultingStaticImports- 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 nodeproject- The Java projectrangeLimit- The range within the source fileskipMethodBodies- If set, do not visit method bodiesresultingTypeImports- The collected import referencesresultingStaticImports- The collected static imports
-
visitNode
protected boolean visitNode(ASTNode node)
- Overrides:
visitNodein classorg.eclipse.jdt.internal.corext.dom.GenericVisitor
-
visit
public boolean visit(SimpleType node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(NameQualifiedType node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(QualifiedType node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(QualifiedName node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ImportDeclaration node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(PackageDeclaration node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(LabeledStatement node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ContinueStatement node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(YieldStatement node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and returns true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ThisExpression node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(SuperFieldAccess node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ClassInstanceCreation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MethodInvocation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(CreationReference node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may re-implement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ExpressionMethodReference node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may re-implement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(SuperMethodReference node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(TypeMethodReference node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(UsesDirective node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may re-implement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(ProvidesDirective node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may re-implement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(SuperConstructorInvocation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(FieldAccess node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(SimpleName node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MarkerAnnotation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(NormalAnnotation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(SingleMemberAnnotation node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(TypeDeclaration node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MethodDeclaration node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(TagElement node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MemberRef node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MethodRef node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
visit
public boolean visit(MethodRefParameter node)
Description copied from class:ASTVisitorVisits the given type-specific AST node.The default implementation does nothing and return true. Subclasses may reimplement.
- Overrides:
visitin classorg.eclipse.jdt.internal.corext.dom.GenericVisitor- Parameters:
node- the node to visit- Returns:
trueif the children of this node should be visited, andfalseif the children of this node should be skipped
-
-