具有通用参数的RestyGWT DirectRestService

时间:2018-12-31 21:12:36

标签: java gwt resty-gwt

我有一个 RestyGWT DirectRestService,看起来像这样:

public interface TestService extends DirectRestService
{
    @GET
    @Path("/findAll")
    <E extends Entity> List<E> findAll(@FormParam("entityName") String entityName);
}

TestService_DirectRestServiceImpl正确生成:

public class TestService_DirectRestServiceImpl implements com.path.to.TestService, org.fusesource.restygwt.client.callback.CallbackAware, org.fusesource.restygwt.client.RestServiceProxy
{
    public <E extends com.path.to.Entity> java.util.List<E> findAll(java.lang.String entityName)
    {
        verifyCallback("findAll");
        service.findAll(entityName, this.callback);
        return null;
    }
}

但是TestService_DirectRestService正在从方法签名(<E extends Entity>部分)中剥离参数定义:

public interface TestService_DirectRestService extends org.fusesource.restygwt.client.RestService
{
    @javax.ws.rs.GET @javax.ws.rs.Path(value = "/findAll")
    void findAll(@javax.ws.rs.FormParam(value = "entityName") java.lang.String entityName, org.fusesource.restygwt.client.MethodCallback<java.util.List<E>> callback);
}

当然,这会导致编译失败,因为找不到通用类型定义:

E cannot be resolved to a type

有人知道如何阻止这种情况的发生吗?还是 RestyGWT 的限制?

0 个答案:

没有答案