Examples of InvocableHandlerMethod


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

    assertFalse(request.getSession().getAttributeNames().hasMoreElements());
  }

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

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

      throws Exception {

    Object handler = new InitBinderHandler();
    Method method = handler.getClass().getMethod(methodName, parameterTypes);

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

    return new InitBinderDataBinderFactory(Arrays.asList(handlerMethod), bindingInitializer);
  }
View Full Code Here

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

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

    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

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

  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

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

    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

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

          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

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

   * @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
Copyright © 2018 www.massapi.com. 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.