0

I want to implement logic that will recursively scan for annotated classes. I can scan the package structure without issue:

Stack<Package> stack = new Stack<Package>();
stack.push(Package.getPackage(ROOT_PACKAGE));
while(!stack.isEmpty()) {
    Package temp = stack.pop();             
    annotatedClasses.addAll(getAnnotatedClasses(temp));         
    for(Package p : temp.getPackages()) {
        stack.push(p);
    }
}

Where I've come unstuck is that I can't seem to find a way to implement this method:

public List<Class> getAnnotatedClasses(Package p);

Given a Package object is there a way to get all Classes within it?

StuPointerException
  • 7,117
  • 5
  • 29
  • 54

1 Answers1

0
Community
  • 1
  • 1
Narendra Pathai
  • 41,187
  • 18
  • 82
  • 120