finding derived classes from base class

S

sakcee

I am trying to find a way to find all the derived classes , given a
parent class, off a source folder or package.
I dont want to load the classes , one way is to have one pass through
code and build a tree with object at root etc

any ideas are appreciated
 
R

Roedy Green

I am trying to find a way to find all the derived classes , given a
parent class, off a source folder or package.
I dont want to load the classes , one way is to have one pass through
code and build a tree with object at root etc

You can read up on the class file format and load the bytes with nio
and have a look. See http://mindprod.com/jgloss/javaclassformat.html

There are also various libraries for manipulating class file byte
codes.
See http://mindprod.com/jgloss/jasm.html
 
S

sakcee

we have many classes that define static values, we want to load them
by class names and with hierarchies.

I am just looking for a way, any way, of finding all derived classes
given a parent
 
V

voorth

we have many classes that define static values, we want to load them
by class names and with hierarchies.

I am just looking for a way, any way, of finding all derived classes
given a parent

On Jul 24, 11:14 pm, "Andrew Thompson" <u32984@uwe> wrote:

In the Eclipse IDE, there is a "Type Hierarchy" view. It gives you a
way to navigate the entire inheritance tree.

Henk
 
L

Lew

This is a stronger requirement than you first stated:
I am trying to find a way to find all the derived classes , given a
parent class, off a source folder or package.

There is no way in general to find /all/ derived classes - it's an unbounded
set over time. It should be possible to find all the derived classes in a
specific source folder (or other resource) at a given moment in time, though.

Eclipse (as voorth stated) and Netbeans both have code to do show class
hierarchies, and they are open source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top