欢迎,我对“GWTENT”反射有疑问。
如何使用反射创建一个类?
我试过这个:
try {
ClassType ct = TypeOracle.Instance.getClassType(Klient.class);
ct.invoke(null, "Klient", null);
} catch (ReflectionRequiredException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
`
打电话给班级:
package pl.cba.lukaszbaczek.client.Test;
import com.extjs.gxt.ui.client.widget.Window;
import com.google.gwt.user.client.Element;
import com.gwtent.reflection.client.Reflectable;
import com.gwtent.reflection.client.Reflection;
@Reflectable
public class Klient extends Window implements Reflection {
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setHeading("Klient");
setSize(600, 600);
}
public Klient(){
super();
show();
}
}
但因错误而失败:
17:30:59.129 [ERROR] [makerbase] Uncaught exception escaped
com.gwtent.reflection.client.NotFoundException: Klient not found or unimplement?