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​(java.lang.String className,
                          ClassNameDeclaration classNameDeclaration)
      • 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 java.util.Map<ClassNameDeclaration,​java.util.List<net.sourceforge.pmd.lang.symboltable.NameOccurrence>> getClassDeclarations()
      • getMethodDeclarations

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

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

        public java.util.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 java.lang.String getClassName()
      • resolveType

        public java.lang.Class<?> resolveType​(java.lang.String name)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object