I would like to get the instance of a reflected class. Let me explain:
I create a new instance of a reflected method in 'A' program:
// Before this, class loading and stuff that are not transcendental for this situation.
Method executeApp = loadedClass.getMethod("execute", Main.class)
executeApp.invoke(loadedClassInstance, MAIN); // This "MAIN" is an instance of "Main" class
And from another program ('B' program):
public class b {
public void execute(net.package.Main instance) {
System.out.println(instance.getUserInput()); // Just an example, the point is to get information from the instance
}
}
I don't have any idea of how I'm going to make 'B' program understand what is net.package.Main
Any idea? Maybe it's not possible...
Aucun commentaire:
Enregistrer un commentaire