当前位置: 首页>>代码示例>>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;未经允许,请勿转载。