Re: detect generics type

2011-02-16 Thread Kurtt
gt; RpcCallBack){ >  Request request = builder.sendRequest(jsonRequest, new RequestCallback() { > @Override > public void onResponseReceived(Request request, Response response) { > if (200 == response.getStatusCode()) { >    // here I need detect generics type of class T > >   ..

Re: detect generics type

2011-02-16 Thread Colin Alworth
Due to how Java does generics by erasure, this is not possible. Instead, try the way that GWT.create() works, where a instance of the expected class is passed in. For example, your method signature could be public static final void callJSONRPCService(Class clazz, AsyncCallback callback); Note

detect generics type

2011-02-16 Thread Jozef Môstka
()) { // here I need detect generics type of class T . } class MyRpcObject{ public parseJSONPresenter(JSONObject json){ //here is convert json object values to properties of this instance } } class TestObject extends MyRpcObject{ . } and use it like callJSONRPCService(new PhpRpcCallback) or