Is there a means to load a class defined as a string?
Example API
string classDef = "class MyClass { private int myVar; public setMyVar(int var) { myVar = var }}"
Class c = loadClass(classDef);
Yes, you can compile and run Java code on the fly. See this blog post as an example: https://blog.frankel.ch/compilation-java-code-on-the-fly/#gsc.tab=0.
There might of course be all kinds of security concerns with compiling and running arbitrary code in your app.