let's say I've got an abstract class with a public constructor that takes a few arguments. This constructor is not overloaded by a subclass.
Given a non-abstract class that extends the above class, I'd like to find all of the constructors I can call to instantiate this object. Included in this list should be the above constructor.
[tt]myClass.getConstructors()[/tt] will only return the public constructors for that particular class, not the public constructors for the parent classes. I can't use [tt]myClass.getSuperclass().getConstructors()[/tt] either, as that will reference the abstract class as the declaring class, and I won't be able to instantiate the object.
How exactly would I go about using reflection to find all of the possible public constructors, for the desired class as well as for all parent classes?
If you want, I could post some test code to demonstrate exactly what I mean.
Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
Given a non-abstract class that extends the above class, I'd like to find all of the constructors I can call to instantiate this object. Included in this list should be the above constructor.
[tt]myClass.getConstructors()[/tt] will only return the public constructors for that particular class, not the public constructors for the parent classes. I can't use [tt]myClass.getSuperclass().getConstructors()[/tt] either, as that will reference the abstract class as the declaring class, and I won't be able to instantiate the object.
How exactly would I go about using reflection to find all of the possible public constructors, for the desired class as well as for all parent classes?
If you want, I could post some test code to demonstrate exactly what I mean.
Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."