Class DOMToModelPopulator

java.lang.Object
org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor
org.aspectj.org.eclipse.jdt.internal.core.DOMToModelPopulator

public class DOMToModelPopulator extends ASTVisitor
Process an AST to populate a tree of IJavaElement->JavaElementInfo. DOM-first approach to what legacy implements through ECJ parser and CompilationUnitStructureRequestor
  • Constructor Details

  • Method Details

    • visit

      public boolean visit(CompilationUnit 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 ASTVisitor
      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 ASTVisitor
      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
    • endVisit

      public void endVisit(PackageDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • 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 ASTVisitor
      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
    • endVisit

      public void endVisit(ImportDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(ImplicitTypeDeclaration node)
      Description copied from class: ASTVisitor
      Visits the given type-specific AST node.

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

      Overrides:
      visit in class ASTVisitor
      Parameters:
      node - the ImplicitTypeDeclaration to visit
      Returns:
      true if the children of this node should be visited, and false if the children of this node should be skipped
    • endVisit

      public void endVisit(ImplicitTypeDeclaration node)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      node - the node to visit
    • 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 ASTVisitor
      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
    • endVisit

      public void endVisit(TypeDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(AnnotationTypeDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(AnnotationTypeDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(EnumDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(EnumDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(EnumConstantDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(EnumConstantDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(RecordDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(RecordDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may re implement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(SingleVariableDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(SingleVariableDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(MethodDeclaration method)
      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 ASTVisitor
      Parameters:
      method - 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
    • endVisit

      public void endVisit(MethodDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(AnnotationTypeMemberDeclaration method)
      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 ASTVisitor
      Parameters:
      method - 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
    • endVisit

      public void endVisit(AnnotationTypeMemberDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(TypeParameter 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 ASTVisitor
      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
    • endVisit

      public void endVisit(TypeParameter typeParam)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      typeParam - the node to visit
    • 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 ASTVisitor
      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
    • endVisit

      public void endVisit(NormalAnnotation decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • 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 ASTVisitor
      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
    • endVisit

      public void endVisit(MarkerAnnotation decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • 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 ASTVisitor
      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
    • endVisit

      public void endVisit(SingleMemberAnnotation decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(AnonymousClassDeclaration decl)
      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 ASTVisitor
      Parameters:
      decl - 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
    • endVisit

      public void endVisit(AnonymousClassDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • memberValue

      public Map.Entry<Object,Integer> memberValue(Expression dom)
    • toLocalVariable

      public static LocalVariable toLocalVariable(SingleVariableDeclaration parameter, JavaElement parent)
    • visit

      public boolean visit(FieldDeclaration field)
      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 ASTVisitor
      Parameters:
      field - 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
    • endVisit

      public void endVisit(FieldDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(Initializer 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 ASTVisitor
      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
    • endVisit

      public void endVisit(Initializer decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(ModuleDeclaration 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 ASTVisitor
      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
    • endVisit

      public void endVisit(ModuleDeclaration decl)
      Description copied from class: ASTVisitor
      End of visit the given type-specific AST node.

      The default implementation does nothing. Subclasses may reimplement.

      Overrides:
      endVisit in class ASTVisitor
      Parameters:
      decl - the node to visit
    • visit

      public boolean visit(LambdaExpression 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 ASTVisitor
      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 ASTVisitor
      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 ASTVisitor
      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 ASTVisitor
      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 ASTVisitor
      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