Package javax.ws.rs

Examples of javax.ws.rs.HttpMethod


  private static boolean hasJaxRsAnnotation(Method method) {
    for (Annotation annotation : method.getAnnotations()) {
      Class<?> annotationType = annotation.annotationType();

      HttpMethod httpType = (HttpMethod) annotationType
          .getAnnotation(HttpMethod.class);

      if (httpType != null || annotationType.equals(Consumes.class)
          || annotationType.equals(Produces.class)
          || annotationType.equals(Path.class)
View Full Code Here


                methodName = ((HttpMethod)a).value();
                break;
            }
            // Http method related annotations such as @GET, @POST will have itself annotated with
            // @HttpMethod
            HttpMethod m = a.annotationType().getAnnotation(HttpMethod.class);
            if (m != null) {
                methodName = m.value();
                break;
            }
        }

        boolean jaxrs = false;
View Full Code Here

            if (annotationType == HttpMethod.class) {
                return true;
            }
            // Http method related annotations such as @GET, @POST will have itself annotated with
            // @HttpMethod
            HttpMethod m = a.annotationType().getAnnotation(HttpMethod.class);
            if (m != null) {
                return true;
            }
        }
        return false;
View Full Code Here

   
  
   
    public static String getHttpMethodValue(Method m) {
        for (Annotation a : m.getAnnotations()) {
            HttpMethod httpM = a.annotationType().getAnnotation(HttpMethod.class);
            if (httpM != null) {
                return httpM.value();
            }
        }
        return null;
    }
View Full Code Here

   }

   public static Optional<String> tryFindHttpMethod(Invokable<?, ?> method) {
      Builder<String> methodsBuilder = ImmutableSet.builder();
      for (Annotation annotation : method.getAnnotations()) {
         HttpMethod http = annotation.annotationType().getAnnotation(HttpMethod.class);
         if (http != null)
            methodsBuilder.add(http.value());
      }
      Collection<String> methods = methodsBuilder.build();
      switch (methods.size()) {
      case 0:
         return Optional.absent();
View Full Code Here

   
  
   
    public static String getHttpMethodValue(Method m) {
        for (Annotation a : m.getAnnotations()) {
            HttpMethod httpM = a.annotationType().getAnnotation(HttpMethod.class);
            if (httpM != null) {
                return httpM.value();
            }
        }
        return null;
    }
View Full Code Here

        MethodMetadata metadata = new MethodMetadata(getMetadata());
        metadata.setReflectionMethod(method);

        boolean hasAnnotation = false;

        HttpMethod httpMethod = getHttpMethod(method);
        if (httpMethod != null) {
            hasAnnotation = true;
            metadata.setHttpMethod(httpMethod.value());
        }

        Path path = getPath(method);
        if (path != null) {
            hasAnnotation = true;
View Full Code Here

    }

    private HttpMethod getHttpMethod(Method method) {
        // search if any of the annotations is annotated with HttpMethod
        // such as @GET
        HttpMethod httpMethod = null;
        for (Annotation annotation : method.getAnnotations()) {
            HttpMethod httpMethodCurr = annotation.annotationType().getAnnotation(HttpMethod.class);
            if (httpMethodCurr != null) {
                if (httpMethod != null) {
                    throw new IllegalStateException(String
                        .format("Multiple http method annotations on method %s in class %s", method
                            .getName(), method.getDeclaringClass().getCanonicalName()));
View Full Code Here

   
  
   
    public static String getHttpMethodValue(Method m) {
        for (Annotation a : m.getAnnotations()) {
            HttpMethod httpM = a.annotationType().getAnnotation(HttpMethod.class);
            if (httpM != null) {
                return httpM.value();
            }
        }
        return null;
    }
View Full Code Here

        return null;
    }

    public static String getHttpMethodValue(Method m) {
        for (Annotation a : m.getAnnotations()) {
            HttpMethod httpM = a.annotationType().getAnnotation(HttpMethod.class);
            if (httpM != null) {
                return httpM.value();
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.HttpMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.