Package org.springframework.web.method.support

Examples of org.springframework.web.method.support.InvocableHandlerMethod


  }


  private HandlerMethod handlerMethod(Object handler, String methodName, Class<?>... paramTypes) throws Exception {
    Method method = handler.getClass().getDeclaredMethod(methodName, paramTypes);
    return new InvocableHandlerMethod(handler, method);
  }
View Full Code Here


    Class<?> type = controller.getClass();
    Set<Method> methods = HandlerMethodSelector.selectMethods(type, METHOD_FILTER);
    List<InvocableHandlerMethod> modelMethods = new ArrayList<InvocableHandlerMethod>();
    for (Method method : methods) {
      InvocableHandlerMethod modelMethod = new InvocableHandlerMethod(controller, method);
      modelMethod.setHandlerMethodArgumentResolvers(resolvers);
      modelMethod.setDataBinderFactory(dataBinderFactory);
      modelMethods.add(modelMethod);
    }
    Collections.shuffle(modelMethods);

    SessionAttributesHandler sessionHandler = new SessionAttributesHandler(type, this.sessionAttributeStore);
View Full Code Here

  private NativeWebRequest webRequest;

  @Before
  public void setUp() throws Exception {
    Class<?> handlerType = handler.getClass();
    handleMethod = new InvocableHandlerMethod(handler, handlerType.getDeclaredMethod("handle"));
    Method method = handlerType.getDeclaredMethod("handleSessionAttr", String.class);
    handleSessionAttrMethod = new InvocableHandlerMethod(handler, method);
    sessionAttributeStore = new DefaultSessionAttributeStore();
    sessionAttrsHandler = new SessionAttributesHandler(handlerType, sessionAttributeStore);
    webRequest = new ServletWebRequest(new MockHttpServletRequest());
  }
View Full Code Here

    Method method = ModelHandler.class.getMethod(methodName, parameterTypes);

    HandlerMethodArgumentResolverComposite argResolvers = new HandlerMethodArgumentResolverComposite();
    argResolvers.addResolver(new ModelMethodProcessor());

    InvocableHandlerMethod handlerMethod = new InvocableHandlerMethod(handler, method);
    handlerMethod.setHandlerMethodArgumentResolvers(argResolvers);
    handlerMethod.setDataBinderFactory(null);
    handlerMethod.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());

    return new ModelFactory(Arrays.asList(handlerMethod), null, sessionAttrsHandler);
  }
View Full Code Here

          RequestMappingHandlerAdapter.INIT_BINDER_METHODS);
      this.initBinderMethodCache.put(handlerType, binderMethods);
    }

    for (Method method : binderMethods) {
      InvocableHandlerMethod binderMethod = createInvocableBinderMethod(bean, method);
      binderMethod.setHandlerMethodArgumentResolvers(this.initBinderArgumentResolvers);
      binderMethod.setDataBinderFactory(new DefaultDataBinderFactory(this.webBindingInitializer));
      binderMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
      initBinderMethods.add(binderMethod);
    }

    return new ServletRequestDataBinderFactory(initBinderMethods, this.webBindingInitializer);
  }
View Full Code Here

   * @param handler the handler
   * @param method the binder method to invoke
   * @return a new {@link InvocableHandlerMethod} instance
   */
  protected InvocableHandlerMethod createInvocableBinderMethod(Object handler, Method method) {
    return new InvocableHandlerMethod(handler, method);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.method.support.InvocableHandlerMethod

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.