Package javax.ws.rs

Examples of javax.ws.rs.HttpMethod


        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 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

        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

        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(Messages
                        .getMessage("multipleHttpMethodAnnotations", method //$NON-NLS-1$
                            .getName(), method.getDeclaringClass().getCanonicalName()));
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

        }
        return target;
    }

    private static String getHttpMethodName(final AnnotatedElement ae) {
        final HttpMethod a = ae.getAnnotation(HttpMethod.class);
        return a == null ? null : a.value();
    }
View Full Code Here

    private JAXRSUtils() {       
    }
   
    public static String getHttpMethodValue(Method m) {
        for (Annotation a : m.getAnnotations()) {
            HttpMethod httpM = a.annotationType().getAnnotation(HttpMethod.class);
            if (httpM != null) {
                return httpM.value();
            }
        }
        // TODO : make it shorter
        for (Class<?> i : m.getDeclaringClass().getInterfaces()) {
            try {
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.