Пример #1
0
 public ResourceMethod(MethodDoc method, MethodDoc declaringMethod, ResourceClass resource) {
   this.resource = resource;
   this.method = method;
   this.declaringClass = resource.getDeclaringClass();
   this.declaringMethod = declaringMethod;
   this.output = new MethodOutput(declaringMethod);
   try {
     formClass = Class.forName("org.jboss.resteasy.annotations.Form");
   } catch (ClassNotFoundException e) {
     // we won't support @Form
   }
   setupPath();
   setupParameters();
   setupMethods();
   setupMIMEs();
   // is this a resource locator?
   if (methods.isEmpty() && !declaringMethod.returnType().isPrimitive()) {
     // Handle Class style resource locator factory methods
     Type t = declaringMethod.returnType();
     if ("java.lang.Class".equals(t.qualifiedTypeName())) {
       ParameterizedType p = t.asParameterizedType();
       if (p != null) {
         t = p.typeArguments()[0];
       }
     }
     resourceLocator = new ResourceClass(t.asClassDoc(), this);
   }
 }