Class ClassScope

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.symboltable.Scope

    public class ClassScope
    extends AbstractJavaScope
    This scope represents one Java class. It can have variable declarations, method declarations and inner class declarations.
    • Constructor Detail

      • ClassScope

        public ClassScope​(ClassNameDeclaration classNameDeclaration)
        This is only for anonymous inner classes.

        FIXME - should have name like Foo$1, not Anonymous$1 to get this working right, the parent scope needs to be passed in when instantiating a ClassScope

        Parameters:
        classNameDeclaration - The declaration of this class, as known to the parent scope.
    • Method Detail

      • setIsEnum

        public void setIsEnum​(boolean isEnum)
      • getClassDeclarations

        public Map<ClassNameDeclaration,​List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getClassDeclarations()
      • getMethodDeclarations

        public Map<MethodNameDeclaration,​List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getMethodDeclarations()
      • getVariableDeclarations

        public Map<VariableNameDeclaration,​List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getVariableDeclarations()
      • addNameOccurrence

        public Set<net.sourceforge.pmd.lang.symboltable.NameDeclaration> addNameOccurrence​(net.sourceforge.pmd.lang.symboltable.NameOccurrence occurrence)
        Specified by:
        addNameOccurrence in interface net.sourceforge.pmd.lang.symboltable.Scope
        Overrides:
        addNameOccurrence in class net.sourceforge.pmd.lang.symboltable.AbstractScope
      • getClassName

        public String getClassName()
      • resolveType

        public Class<?> resolveType​(String name)