use of net.sourceforge.pmd.lang.java.symboltable.ClassNameDeclaration in project pmd by pmd.
the class AccessorMethodGenerationRule method analyzeScope.
private void analyzeScope(final AbstractJavaScope file, final Object data) {
for (final ClassNameDeclaration classDecl : file.getDeclarations(ClassNameDeclaration.class).keySet()) {
final ClassScope classScope = (ClassScope) classDecl.getScope();
// Check fields
for (final Map.Entry<VariableNameDeclaration, List<NameOccurrence>> varDecl : classScope.getVariableDeclarations().entrySet()) {
final ASTFieldDeclaration field = varDecl.getKey().getNode().getFirstParentOfType(ASTFieldDeclaration.class);
analyzeMember(field, varDecl.getValue(), classScope, data);
}
// Check methods
for (final Map.Entry<MethodNameDeclaration, List<NameOccurrence>> methodDecl : classScope.getMethodDeclarations().entrySet()) {
final ASTMethodDeclaration method = methodDecl.getKey().getNode().getFirstParentOfType(ASTMethodDeclaration.class);
analyzeMember(method, methodDecl.getValue(), classScope, data);
}
// Check inner classes
analyzeScope(classScope, data);
}
}
Aggregations