java - Get all classnames that extend a specific class -


in java project, need variable each class extends class. problem here don't know name of these classes. let's classtree looks this:

package  - myproject  - baseclass  - class 1 extends baseclass  - class 2 extends baseclass  - class 3 extends baseclass  - class 4  - class 5 

now each class extends baseclass has variable basevariable, , need value in myproject. there way list of classes extend baseclass, can access basevariable value?

thanks in advance

you use reflections:

set<class<? extends baseclass>> subclasses = reflections.getsubtypesof(baseclass.class); 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -