예제 #1
0
  @Test
  public void resourceTest() {

    Resource.Builder builder = Resource.builder(LightMareBean.class);
    Resource resource = builder.build();
    System.out.println(resource.getName());
    System.out.println(resource);

    List<ResourceMethod> methods = resource.getAllMethods();
    // ResourceMethod.Builder methodBuilder;
    // String name = resource.getName();
    Collection<Class<?>> handlers = resource.getHandlerClasses();
    System.out.println(handlers);
    Class<?> beanClass;
    Method realMethod;
    List<Parameter> parameters;
    for (ResourceMethod method : methods) {
      System.out.println(method);
      realMethod = method.getInvocable().getHandlingMethod();
      realMethod.getParameterTypes();
      MethodHandler handler = method.getInvocable().getHandler();
      List<? extends ResourceModelComponent> components = method.getInvocable().getComponents();
      parameters = method.getInvocable().getParameters();
      MethodHandler methodHandler = method.getInvocable().getHandler();
      System.out.println(methodHandler);
      for (Parameter parameter : parameters) {
        System.out.println(parameter);
        System.out.println(parameter.getRawType());
      }
      System.out.println(components);
      beanClass = handler.getHandlerClass();
      System.out.println(beanClass);
      System.out.println(realMethod);
    }
  }