private static <T> RestfulClientInvoker 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( "You must use at least one, but no more than one http method annotation on: " + method.toString()); } RestfulClientInvoker invoker = new RestfulClientInvoker(base, clazz, method, config); invoker.setHttpMethod(httpMethods.iterator().next()); return invoker; }
private static boolean isInvokerMethod(Method method) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); return httpMethods != null && httpMethods.size() == 1; }
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; }
private ClientInvoker createClientInvoker(ClientContext context, URI uri, Method method) { ClientInvoker clientInvoker = new ClientInvoker((ResteasyWebTarget)(context.getInvocation().getClient().target(uri)), method.getDeclaringClass(), method, new ProxyConfig(Thread.currentThread().getContextClassLoader(), null, null)); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); clientInvoker.setHttpMethod(httpMethods.iterator().next()); return clientInvoker; }
Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if ((httpMethods == null || httpMethods.size() == 0) && method.isAnnotationPresent(Path.class) && method.getReturnType().isInterface())
private void removeRegistration(String base, Class<?> clazz) { for (Method method : clazz.getMethods()) { Path path = method.getAnnotation(Path.class); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (path == null && httpMethods == null) continue; ResteasyUriBuilder builder = new ResteasyUriBuilderImpl(); if (base != null) builder.path(base); if (clazz.isAnnotationPresent(Path.class)) builder.path(clazz); String classExpression = builder.getPath(); if (path != null) builder.path(method); String fullpath = builder.getPath(); if (fullpath == null) fullpath = ""; if (widerMatching) rootNode.removeBinding(fullpath, method); else root.removeBinding(classExpression, fullpath, method); } }
private static boolean isInvokerMethod(Method method) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); return httpMethods != null && httpMethods.size() == 1; }
private static boolean isInvokerMethod(Method method) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); return httpMethods != null && httpMethods.size() == 1; }
private static boolean isInvokerMethod(Method method) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); return httpMethods != null && httpMethods.size() == 1; }
private static boolean isInvokerMethod(Method method) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); return httpMethods != null && httpMethods.size() == 1; }
@Override public boolean matches(Method m) { Set<String> verbs = IsHttpMethod.getHttpMethods(m); return verbs != null && !verbs.isEmpty() && !m.isSynthetic(); } }
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; }
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; }
public static <T> ClientInvoker createClientInvoker(Class<T> clazz, Method method, URI baseUri, ProxyConfig config) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (httpMethods == null || httpMethods.size() != 1) { throw new RuntimeException(Messages.MESSAGES.mustUseOneHttpMethod(method.toString())); } ClientInvoker invoker = new ClientInvoker(baseUri, clazz, method, config); invoker.getAttributes().putAll(config.getRequestAttributes()); ClientInvokerInterceptorFactory.applyDefaultInterceptors(invoker, config.getProviderFactory(), clazz, method); invoker.setHttpMethod(httpMethods.iterator().next()); return invoker; } }
private ClientInvoker createClientInvoker(ClientContext context, URI uri, Method method) { ClientInvoker clientInvoker = new ClientInvoker((ResteasyWebTarget)(context.getInvocation().getClient().target(uri)), method.getDeclaringClass(), method, new ProxyConfig(Thread.currentThread().getContextClassLoader(), null, null)); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); clientInvoker.setHttpMethod(httpMethods.iterator().next()); return clientInvoker; }
private ClientInvoker createClientInvoker(ClientContext context, URI uri, Method method) { ClientInvoker clientInvoker = new ClientInvoker((ResteasyWebTarget)(context.getInvocation().getClient().target(uri)), method.getDeclaringClass(), method, new ProxyConfig(Thread.currentThread().getContextClassLoader(), null, null)); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); clientInvoker.setHttpMethod(httpMethods.iterator().next()); return clientInvoker; }
public static <T> ClientInvoker createClientInvoker(Class<T> clazz, Method method, URI baseUri, ProxyConfig config) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (httpMethods == null || httpMethods.size() != 1) { throw new RuntimeException(Messages.MESSAGES.mustUseOneHttpMethod(method.toString())); } ClientInvoker invoker = new ClientInvoker(baseUri, clazz, method, config); invoker.getAttributes().putAll(config.getRequestAttributes()); ClientInvokerInterceptorFactory.applyDefaultInterceptors(invoker, config.getProviderFactory(), clazz, method); invoker.setHttpMethod(httpMethods.iterator().next()); return invoker; } }
Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if ((httpMethods == null || httpMethods.size() == 0) && method.isAnnotationPresent(Path.class) && method.getReturnType().isInterface())
private void removeRegistration(String base, Class<?> clazz) { for (Method method : clazz.getMethods()) { Path path = method.getAnnotation(Path.class); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (path == null && httpMethods == null) continue; ResteasyUriBuilder builder = new ResteasyUriBuilder(); if (base != null) builder.path(base); if (clazz.isAnnotationPresent(Path.class)) builder.path(clazz); String classExpression = builder.getPath(); if (path != null) builder.path(method); String fullpath = builder.getPath(); if (fullpath == null) fullpath = ""; if (widerMatching) rootNode.removeBinding(fullpath, method); else root.removeBinding(classExpression, fullpath, method); } }
private void removeRegistration(String base, Class<?> clazz) { for (Method method : clazz.getMethods()) { Path path = method.getAnnotation(Path.class); Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (path == null && httpMethods == null) continue; ResteasyUriBuilder builder = new ResteasyUriBuilderImpl(); if (base != null) builder.path(base); if (clazz.isAnnotationPresent(Path.class)) builder.path(clazz); String classExpression = builder.getPath(); if (path != null) builder.path(method); String fullpath = builder.getPath(); if (fullpath == null) fullpath = ""; if (widerMatching) rootNode.removeBinding(fullpath, method); else root.removeBinding(classExpression, fullpath, method); } }