当前位置: 首页>>代码示例>>Java>>正文


Java Method类代码示例

本文整理汇总了Java中com.google.gwt.http.client.RequestBuilder.Method的典型用法代码示例。如果您正苦于以下问题:Java Method类的具体用法?Java Method怎么用?Java Method使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Method类属于com.google.gwt.http.client.RequestBuilder包,在下文中一共展示了Method类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
@Before
public void init() throws Exception {
    MockI18n.mock(ServerIneFormI18nProvider.class);
    MockitoAnnotations.initMocks(this);
    descriptorStore = TestUtil.descriptorStore;
    testKvo = (KeyValueObject) TestUtil.getTestKvo().getAssistedObject();
    when(requestBuilderFactory.createBuilder(any(Method.class), anyString()))
        .thenReturn(requestBuilder);
    restDataConnector = new RestDataConnector(
        Mockito.mock(EventBus.class),
        Mockito.mock(AsyncStatusIndicator.class),
        requestBuilderFactory,
        descriptorStore,
        new AssistedObjectHandlerFactory(descriptorStore),
        "testKvo",
        "getUrl",
        "newUrl",
        "modifyUrl",
        "deleteUrl",
        false);

}
 
开发者ID:inepex,项目名称:ineform,代码行数:23,代码来源:RestDataConnectorComplexTest.java

示例2: AsyncRequest

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
/**
 * Create new {@link AsyncRequest} instance.
 *
 * @param method request method
 * @param url request URL
 * @param async if {@code true} - request will be send in asynchronous mode (as asynchronous
 *     EverRest task).<br>
 *     See <a href="https://github.com/codenvy/everrest/wiki/Asynchronous-Requests">EverRest
 *     Asynchronous requests</a> for details.
 */
protected AsyncRequest(Method method, String url, boolean async) {
  if (async) {
    if (url.contains("?")) {
      url += "&async=true";
    } else {
      url += "?async=true";
    }
  }

  this.requestBuilder = new RequestBuilder(method, url);
  this.async = async;
  this.checkAsyncTaskStatusTimer = new CheckEverRestTaskStatusTimer();
  this.asyncRequestCallback = new EverRestAsyncRequestCallback();
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:AsyncRequest.java

示例3: send

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void send(Method method, HttpCallback<T> cb) {
  HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
  try {
    if (!background) {
      RpcStatus.INSTANCE.onRpcStart();
    }
    request(method).sendRequest(null, httpCallback);
  } catch (RequestException e) {
    httpCallback.onError(null, e);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:RestApi.java

示例4: sendJSON

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void sendJSON(
    Method method, JavaScriptObject content, HttpCallback<T> cb) {
  HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
  try {
    if (!background) {
      RpcStatus.INSTANCE.onRpcStart();
    }
    RequestBuilder req = request(method);
    req.setHeader("Content-Type", JSON_UTF8);
    req.sendRequest(str(content), httpCallback);
  } catch (RequestException e) {
    httpCallback.onError(null, e);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:RestApi.java

示例5: sendText

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private <T extends JavaScriptObject> void sendText(
    Method method, String body, HttpCallback<T> cb) {
  HttpImpl<T> httpCallback = new HttpImpl<>(background, cb);
  try {
    if (!background) {
      RpcStatus.INSTANCE.onRpcStart();
    }
    RequestBuilder req = request(method);
    req.setHeader("Content-Type", TEXT_UTF8);
    req.sendRequest(body, httpCallback);
  } catch (RequestException e) {
    httpCallback.onError(null, e);
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:RestApi.java

示例6: request

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private RequestBuilder request(Method method) {
  RequestBuilder req = new RequestBuilder(method, url());
  if (ifNoneMatch != null) {
    req.setHeader("If-None-Match", ifNoneMatch);
  }
  req.setHeader("Accept", JSON_TYPE);
  if (Gerrit.getXGerritAuth() != null) {
    req.setHeader(HostPageData.XSRF_HEADER_NAME, Gerrit.getXGerritAuth());
  }
  return req;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:RestApi.java

示例7: sendRequest

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
private void sendRequest(final RequestCallback callback, final Method method, final String url) {
    final RequestBuilder builder = new RequestBuilder(method, url);
    builder.setHeader("accept", "application/json");
    try {
        builder.sendRequest(null, callback);
    } catch (final RequestException e) {
        e.printStackTrace();
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:10,代码来源:DefaultKscReportService.java

示例8: createBuilder

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
@Override
public RequestBuilder createBuilder(Method method, String url) {
    return new RequestBuilder(method, url);
}
 
开发者ID:inepex,项目名称:ineform,代码行数:5,代码来源:GwtRequestBuilderFactory.java

示例9: newRequest

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
protected RequestBuilder newRequest(final Method method, final String url) {
  return new RequestBuilder(method, url);
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:4,代码来源:IOServiceGwt.java

示例10: ServletRequestBuilder

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
/**
 * Builds a new {@code ServletRequestBuilder} with the given parameters.
 * 
 * @param injector
 *          The client-side injector.
 * @param requestMethod
 *          request method.
 * @param servlet
 *          The servlet.
 * @param method
 *          The servlet method to execute.
 */
public ServletRequestBuilder(final Injector injector, final Method requestMethod, final Servlet servlet, final ServletMethod method) {
	this.requestMethod = requestMethod;
	this.urlBuilder = new ServletUrlBuilder(injector.getAuthenticationProvider(), injector.getPageManager(), servlet, method);
	this.requestAttributes = new HashMap<String, String>();
	this.urlBuilder.addParameter(ServletConstants.AJAX, ClientUtils.toList(true));
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:19,代码来源:ServletRequestBuilder.java

示例11: createBuilder

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
public RequestBuilder createBuilder(Method method, String url); 
开发者ID:inepex,项目名称:ineform,代码行数:2,代码来源:RequestBuilderFactory.java

示例12: create

import com.google.gwt.http.client.RequestBuilder.Method; //导入依赖的package包/类
RequestBuilder create(Method method, String url); 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:2,代码来源:WfsServiceImpl.java


注:本文中的com.google.gwt.http.client.RequestBuilder.Method类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。