All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.util.IsHttpMethod Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.jboss.resteasy.util;

import javax.ws.rs.HttpMethod;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class IsHttpMethod
{
   public static Set getHttpMethods(Method method)
   {
      HashSet methods = new HashSet();
      for (Annotation annotation : method.getAnnotations())
      {
         HttpMethod http = annotation.annotationType().getAnnotation(HttpMethod.class);
         if (http != null) methods.add(http.value());
      }
      if (methods.size() == 0) return null;
      return methods;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy