The situation is like described below: I got an abstract class with fields and methods and access to all of them (AModule). I got another class extending this abstract class (e.g. TestModule), but I don't know / can't get the java.lang.Class instance of this subclass in the superclass without using a constructor delivering exactly this instance. The subclass type isn't always the same, this is just an example how it currently turned out:
public class TestModule extends AModule
{
public TestModule()
{
super( TestModule.class );
}
}
I need this subclass instance to get all fields and methods to analyse and invoke them via reflection, as defined by annotations. Does anyone get an idea to solve this to get back the default constructor, without this super call with the subclass instance?
Thanks in advance :)
Aucun commentaire:
Enregistrer un commentaire