Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to get all dependencies from a compilation unit?
How to get all dependencies from a compilation unit? [message #250711] Thu, 17 January 2008 18:06 Go to next message
Eclipse UserFriend
Originally posted by: cassio.ufpe.gmail.com

Hello everyone,

Is there any straightfoward way to get all dependencies or all types
depedents of a compilation unit? Do I really have to scan the code using
the ASTVisitor and retrieve each dependence one by one?

The .getAllTypes() method returns only the types declared in the
compilation unit, not its dependencies...

I'm trying to capture classes relationships (imports, method calls, etc)
in order to create a graph of dependencies among classes. By doing so, I
will be able to apply some clustering algorithms in those graphs to
identify possible reusable modules.

Thanks!!
Cassio
Re: How to get all dependencies from a compilation unit? [message #250783 is a reply to message #250711] Tue, 22 January 2008 06:35 Go to previous messageGo to next message
Eclipse UserFriend
I am definitely not the expert in that erea, but I'd look at search APIs.
Maxime
Re: How to get all dependencies from a compilation unit? [message #250812 is a reply to message #250711] Tue, 22 January 2008 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Cassio Melo wrote:
> Hello everyone,
>
> Is there any straightfoward way to get all dependencies or all types
> depedents of a compilation unit? Do I really have to scan the code using
> the ASTVisitor and retrieve each dependence one by one?

Yeah, that's what it seems you need. There are probably ways to make it fast,
but yeah.

> The .getAllTypes() method returns only the types declared in the
> compilation unit, not its dependencies...
>
> I'm trying to capture classes relationships (imports, method calls, etc)
> in order to create a graph of dependencies among classes. By doing so, I
> will be able to apply some clustering algorithms in those graphs to
> identify possible reusable modules.

That sounds cool. What are you working on?

> Thanks!!
> Cassio
>
Re: How to get all dependencies from a compilation unit? [message #250904 is a reply to message #250711] Wed, 23 January 2008 17:16 Go to previous message
Eclipse UserFriend
Cassio Melo wrote:
> Hello everyone,
>
> Is there any straightfoward way to get all dependencies or all types
> depedents of a compilation unit? Do I really have to scan the code using
> the ASTVisitor and retrieve each dependence one by one?
>
> The .getAllTypes() method returns only the types declared in the
> compilation unit, not its dependencies...
>
> I'm trying to capture classes relationships (imports, method calls, etc)
> in order to create a graph of dependencies among classes. By doing so, I
> will be able to apply some clustering algorithms in those graphs to
> identify possible reusable modules.
>
> Thanks!!
> Cassio
>
My advice would be to use SearchEngine.searchDeclarationsOfReferencedTypes
Previous Topic:How to attach sources for JUnit library?
Next Topic:Remote Debugging -- Possible for Debug-ee to connect to Eclipse? server=n?
Goto Forum:
  


Current Time: Sat Apr 19 11:58:59 EDT 2025

Powered by FUDForum. Page generated in 0.02632 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top