This is great, but what if the class in the uncompiled source should inherit from a project specific class (which is already loaded), and has other project dependencies?
As an example, say I want to give users of my software the ability to customize a class at run-time. I have an abstract public class Customizable
and a custom class StatusDetails
in my project, and lets say the user writes code in a file that looks like this:
import com.somepackage.util.StatusDetails;
public class Test extends Customizable {
public Test(){
System.out.println("Initializing Test");
}
@Override
public StatusDetails getStatus(Object params){
StatusDetails status = new StatusDetails();
// Populate status based on params
return status;
}
}
How could I take that and instantiate it?