當前位置: 首頁>>代碼示例>>Java>>正文


Java IsHttpMethod類代碼示例

本文整理匯總了Java中org.jboss.resteasy.util.IsHttpMethod的典型用法代碼示例。如果您正苦於以下問題:Java IsHttpMethod類的具體用法?Java IsHttpMethod怎麽用?Java IsHttpMethod使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IsHttpMethod類屬於org.jboss.resteasy.util包,在下文中一共展示了IsHttpMethod類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createClientInvoker

import org.jboss.resteasy.util.IsHttpMethod; //導入依賴的package包/類
private static <T> ClientInvoker createClientInvoker(Class<T> clazz, Method method, ResteasyWebTarget base, ProxyConfig config) {
    Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
    if (httpMethods == null || httpMethods.size() != 1) {
        throw new RuntimeException(Messages.MESSAGES.mustUseExactlyOneHttpMethod(method.toString()));
    }
    ClientInvoker invoker = new ClientInvoker(base, clazz, method, config);
    invoker.setHttpMethod(httpMethods.iterator().next());
    return invoker;
}
 
開發者ID:wildfly-swarm,項目名稱:wildfly-swarm,代碼行數:10,代碼來源:ProxyBuilder.java

示例2: call

import org.jboss.resteasy.util.IsHttpMethod; //導入依賴的package包/類
public void call(@Observes Before event)
{
    Set<String> httpMethods = IsHttpMethod.getHttpMethods(event.getTestMethod());
    if (httpMethods != null && httpMethods.size() == 1)
    {
        Response response = doRestCall(event.getTestMethod(), httpMethods);
        responseProducer.set(response);
    }
}
 
開發者ID:windup,項目名稱:windup-rulesets,代碼行數:10,代碼來源:RestInvoker.java

示例3: proxy

import org.jboss.resteasy.util.IsHttpMethod; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public static <T> T proxy(final Class<T> iface, WebTarget base, final ProxyConfig config) {
    if (iface.isAnnotationPresent(Path.class)) {
        Path path = iface.getAnnotation(Path.class);
        if (!path.value().equals("") && !path.value().equals("/")) {
            base = base.path(path.value());
        }
    }
    HashMap<Method, MethodInvoker> methodMap = new HashMap<Method, MethodInvoker>();
    for (Method method : iface.getMethods()) {
        // ignore the as method to allow declaration in client interfaces
        if ("as".equals(method.getName()) && Arrays.equals(method.getParameterTypes(), cClassArgArray)) {
            continue;
        }

        // Added by Ken Finnigan
        // Ignore default methods
        if (method.isDefault()) {
            continue;
        }

        MethodInvoker invoker;
        Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
        if ((httpMethods == null || httpMethods.size() == 0) && method.isAnnotationPresent(Path.class) && method.getReturnType().isInterface()) {
            invoker = new SubResourceInvoker((ResteasyWebTarget) base, method, config);
        } else {
            invoker = createClientInvoker(iface, method, (ResteasyWebTarget) base, config);
        }
        methodMap.put(method, invoker);
    }

    Class<?>[] intfs =
            {
                    iface, ResteasyClientProxy.class
            };

    ClientProxy clientProxy = new ClientProxy(methodMap, base, config);
    // this is done so that equals and hashCode work ok. Adding the proxy to a
    // Collection will cause equals and hashCode to be invoked. The Spring
    // infrastructure had some problems without this.
    clientProxy.setClazz(iface);

    return (T) Proxy.newProxyInstance(config.getLoader(), intfs, clientProxy);
}
 
開發者ID:wildfly-swarm,項目名稱:wildfly-swarm,代碼行數:45,代碼來源:ProxyBuilder.java


注:本文中的org.jboss.resteasy.util.IsHttpMethod類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。