Re: finding all Java classes in a project

Sreenivasa Viswanadha <[email protected]> Wed, 25 Jun 2003 08:55:36 -0700
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
>>>
>>>     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.

I am not sure this is the right way to do it. Also, we might end up 
creating too many file objects just
to get the names of classes?

I believe there should be some helper function/util in the Java  module 
that takes a  project and
returns the list of class names. For example, one could implement this 
using the MDR which
IMO, is the most correct way.

Sreeni.