// Static Reflection Method
Class C = Class. forname ("Class Name ");
M = C. getmethod ("method name", new class [] {several parameter types });
// Get the returned object
Object objmodel = M. Invoke (C, new object [] {several parameters });
Class classmodel = objapp. getclass ();
// Obtain the parent class
Classmodel = classmodel. getsuperclass ();
Field F = classmodel. getdeclaredfield ("attribute name ");
// Method for obtaining private attributes
F. setaccessible (true );
Appname = f. Get (objmodel). tostring ();
For reflection calls, the objects to be instantiated are as follows:
Class C = Class. forname ("Class Name ");
Object o = C. getdeclaredconstructor (new class [] {several parameter types}). newinstance (new object [] {several parameters });
M = C. getdeclaredmethod ("method name ");
Document docreturn = (document) M. Invoke (O );