Re: finding all Java classes in a project

Vitezslav Stejskal <[email protected]> Wed, 25 Jun 2003 13:12:56 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>

Svatopluk Dedic wrote:

> Dave Weatherford wrote:
>
[snip]

>>
>>     Iterator cuit = cus.iterator();
>>     while ( cuit.hasNext() ) {
>>         CompilationUnit cu = (CompilationUnit)cuit.next();
>
>
> At this point, you may retrieve getBuildTarget() and query the 
> target's output FileSet (which saves you from walking the java.io.File 
> subtrees manually). 

Implementing FileSet entries as described in 
http://www.netbeans.org/issues/show_bug.cgi?id=33905 will also help with 
this. Iterating through the FileSet's entries would give you relative 
path to the root for each FileObject in the FileSet and this relative 
path can be easily converted to the classname.

-vita