net.sourceforge.pmd.lang.java.symboltable

## Class ScopeAndDeclarationFinder

- java.lang.Object
- - net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter
  - - net.sourceforge.pmd.lang.java.symboltable.ScopeAndDeclarationFinder

- All Implemented Interfaces:
    JavaParserVisitor

      public class ScopeAndDeclarationFinder
      extends JavaParserVisitorAdapter

  Visitor for scope creation. Visits all nodes of an AST and creates scope objects for nodes representing syntactic entities which may contain declarations. For example, a block may contain variable definitions (which are declarations) and therefore needs a scope object where these declarations can be associated, whereas an expression can't contain declarations and therefore doesn't need a scope object. With the exception of global scopes, each scope object is linked to its parent scope, which is the scope object of the next embedding syntactic entity that has a scope.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScopeAndDeclarationFinder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `visit(ASTAnnotationTypeDeclaration node, Object data)`
    `Object` | `visit(ASTBlock node, Object data)`
    `Object` | `visit(ASTCatchStatement node, Object data)`
    `Object` | `visit(ASTClassOrInterfaceBodyDeclaration node, Object data)`
    `Object` | `visit(ASTClassOrInterfaceDeclaration node, Object data)`
    `Object` | `visit(ASTCompilationUnit node, Object data)`
    `Object` | `visit(ASTConstructorDeclaration node, Object data)`
    `Object` | `visit(ASTEnumDeclaration node, Object data)`
    `Object` | `visit(ASTFinallyStatement node, Object data)`
    `Object` | `visit(ASTForStatement node, Object data)`
    `Object` | `visit(ASTIfStatement node, Object data)`
    `Object` | `visit(ASTMethodDeclaration node, Object data)`
    `Object` | `visit(ASTSwitchStatement node, Object data)`
    `Object` | `visit(ASTTryStatement node, Object data)`
    `Object` | `visit(ASTVariableDeclaratorId node, Object data)`

    - ### Methods inherited from class net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter

      `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, 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 java.lang.Object

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

- - ### Constructor Detail

    - #### ScopeAndDeclarationFinder

          public ScopeAndDeclarationFinder()

  - ### Method Detail

    - #### visit

          public Object visit(ASTCompilationUnit node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTClassOrInterfaceDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTEnumDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTAnnotationTypeDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTClassOrInterfaceBodyDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTBlock node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTCatchStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTFinallyStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTConstructorDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTMethodDeclaration node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTTryStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTForStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTIfStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTVariableDeclaratorId node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

    - #### visit

          public Object visit(ASTSwitchStatement node,
                     Object data)

      Specified by:
        `visit` in interface `JavaParserVisitor`
      Overrides:
        `visit` in class `JavaParserVisitorAdapter`

Copyright © 2002-2013 InfoEther. All Rights Reserved.