finding derived classes from base class

Discussion in 'Java' started by sakcee@gmail.com, Jul 25, 2007.

  1. Guest

    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
     
    , Jul 25, 2007
    #1
    1. Advertising

  2. Roedy Green Guest

    On Tue, 24 Jul 2007 22:25:59 -0700, ""
    <> wrote, quoted or indirectly quoted someone who said
    :

    >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
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jul 25, 2007
    #2
    1. Advertising

  3. Andrew Thompson, Jul 25, 2007
    #3
  4. Guest

    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:
    > wrote:
    > >I am trying to find a way to find all the derived classes , given a
    > >parent class, off a source folder or package.

    >
    > Why?
    >
    > >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

    >
    > Ask a specific question.
    >
    > --
    > Andrew Thompsonhttp://www.athompson.info/andrew/
    >
    > Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200707/1
     
    , Jul 25, 2007
    #4
  5. voorth Guest

    On Jul 25, 9:34 am, "" <> wrote:
    > 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
     
    voorth, Jul 25, 2007
    #5
  6. Lew Guest

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


    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.

    --
    Lew
     
    Lew, Jul 25, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Colin Goudie
    Replies:
    6
    Views:
    497
    Victor Bazarov
    Jan 26, 2004
  2. Replies:
    4
    Views:
    431
    Alf P. Steinbach
    May 23, 2007
  3. Replies:
    1
    Views:
    412
    myork
    May 23, 2007
  4. Replies:
    1
    Views:
    400
    Victor Bazarov
    May 23, 2007
  5. Replies:
    2
    Views:
    738
Loading...

Share This Page