Package org.jrest4guice.rest.annotations

Examples of org.jrest4guice.rest.annotations.HttpMethodType


      uri = uri.replace(this.urlPrefix, "");

    // ==================================================================
    // 处理html不支持put/delete方法的情况下通过在url中补!update与!delete
    // ==================================================================
    HttpMethodType method_type = null;
    if (uri.indexOf("!update") != -1) {
      method_type = HttpMethodType.PUT;
    }
    if (uri.indexOf("!delete") != -1) {
      method_type = HttpMethodType.DELETE;
View Full Code Here


    Class<?> clazz = service.getClass();
    Method[] methods = clazz.getMethods();
    Map<String, Method> restMethods = new HashMap<String, Method>(
        0);
    String methodName;
    HttpMethodType type = null;
    for (Method m : methods) {
      type = null;
      methodName = m.getName();
      if (methodName.equalsIgnoreCase("getClass")
          || m.isAnnotationPresent(Path.class))
        continue;

      type = JRestGuiceProcessorHelper.getHttpMethodType(m);

      if (type != null){
        if(type == HttpMethodType.ACTION) {
          String value = m.getAnnotation(Action.class).value();
          if(value.trim().equals(""))
            value = m.getName();
          restMethods.put(type.name()+":"+value, m);
        } else
          restMethods.put(type.name(), m);
      }
    }

    restServiceMethodMap.put(name, restMethods);
  }
View Full Code Here

    return null;
  }
 
  public static HttpMethodType getHttpMethodType(Method m) {
    String methodName = m.getName();
    HttpMethodType type = null;
    if (m.isAnnotationPresent(Get.class)) {
      type = HttpMethodType.GET;
    } else if (m.isAnnotationPresent(Post.class)) {
      type = HttpMethodType.POST;
    } else if (m.isAnnotationPresent(Put.class)) {
View Full Code Here

TOP

Related Classes of org.jrest4guice.rest.annotations.HttpMethodType

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.