Package org.springframework.core

Examples of org.springframework.core.LocalVariableTableParameterNameDiscoverer$LocalVariableTableVisitor


                    return instantiateWithMethodInjection(beanDefinition, beanName, owner);
                }
            });
        }

        setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());
        setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());
        ignoreDependencyType(Closure.class);
    }
View Full Code Here


     * Intended for testing. Don't use in practice as it creates a new parameter resolver
     * for each instance. Use the constructor which takes the resolver, as an argument thus
     * allowing for caching.
     */
    public MethodSecurityEvaluationContext(Authentication user, MethodInvocation mi) {
        this(user, mi, new LocalVariableTableParameterNameDiscoverer());
    }
View Full Code Here

    cavs2.addGenericArgumentValue(MARK);
    RootBeanDefinition person2 = new RootBeanDefinition(Person.class, cavs2, null);
    lbf.registerBeanDefinition(MARK, person2);
    MethodParameter param = new MethodParameter(QualifiedTestBean.class.getDeclaredConstructor(Person.class), 0);
    DependencyDescriptor qualifiedDescriptor = new DependencyDescriptor(param, false);
    param.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    assertEquals("tpb", param.getParameterName());
    assertTrue(lbf.isAutowireCandidate(JUERGEN, null));
    assertTrue(lbf.isAutowireCandidate(JUERGEN, qualifiedDescriptor));
    assertFalse(lbf.isAutowireCandidate(MARK, qualifiedDescriptor));
  }
View Full Code Here

        new MethodParameter(QualifiedTestBean.class.getDeclaredMethod("autowireQualified", Person.class), 0);
    MethodParameter nonqualifiedParam =
        new MethodParameter(QualifiedTestBean.class.getDeclaredMethod("autowireNonqualified", Person.class), 0);
    DependencyDescriptor qualifiedDescriptor = new DependencyDescriptor(qualifiedParam, false);
    DependencyDescriptor nonqualifiedDescriptor = new DependencyDescriptor(nonqualifiedParam, false);
    qualifiedParam.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    assertEquals("tpb", qualifiedParam.getParameterName());
    nonqualifiedParam.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    assertEquals("tpb", nonqualifiedParam.getParameterName());
    assertTrue(lbf.isAutowireCandidate(JUERGEN, null));
    assertTrue(lbf.isAutowireCandidate(JUERGEN, nonqualifiedDescriptor));
    assertTrue(lbf.isAutowireCandidate(JUERGEN, qualifiedDescriptor));
    assertTrue(lbf.isAutowireCandidate(MARK, null));
View Full Code Here

    Method method = getClass().getMethod("handle", String.class, List.class, int.class);
    this.paramString = new MethodParameter(method, 0);
    this.paramColors = new MethodParameter(method, 1);
    this.paramYear = new MethodParameter(method, 2);

    this.paramColors.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());

    this.mavContainer = new ModelAndViewContainer();
    this.request = new MockHttpServletRequest();
    this.webRequest = new ServletWebRequest(request, new MockHttpServletResponse());
View Full Code Here

    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

  @Before
  public void setUp() throws Exception {
    resolver = new RequestParamMethodArgumentResolver(null, true);

    ParameterNameDiscoverer paramNameDiscoverer = new LocalVariableTableParameterNameDiscoverer();

    Method method = getClass().getMethod("params", String.class, String[].class,
        Map.class, MultipartFile.class, List.class, MultipartFile[].class,
        Part.class, List.class, Part[].class, Map.class,
        String.class, MultipartFile.class, List.class, Part.class,
View Full Code Here

        SimpleBean.class, MultipartFile.class, List.class, MultipartFile[].class,
        Integer.TYPE, MultipartFile.class, Part.class, List.class,
        Part[].class, MultipartFile.class);

    paramRequestPart = new MethodParameter(method, 0);
    paramRequestPart.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    paramNamedRequestPart = new MethodParameter(method, 1);
    paramValidRequestPart = new MethodParameter(method, 2);
    paramMultipartFile = new MethodParameter(method, 3);
    paramMultipartFileList = new MethodParameter(method, 4);
    paramMultipartFileArray = new MethodParameter(method, 5);
    paramInt = new MethodParameter(method, 6);
    paramMultipartFileNotAnnot = new MethodParameter(method, 7);
    paramMultipartFileNotAnnot.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    paramPart = new MethodParameter(method, 8);
    paramPart.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
    paramPartList = new MethodParameter(method, 9);
    paramPartArray = new MethodParameter(method, 10);
    paramRequestParamAnnot = new MethodParameter(method, 11);

    messageConverter = mock(HttpMessageConverter.class);
View Full Code Here

    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

   * @see #refresh
   */
  public GenericApplicationContext() {
    this.beanFactory = new DefaultListableBeanFactory();
    this.beanFactory.setSerializationId(getId());
    this.beanFactory.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());
    this.beanFactory.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());
  }
View Full Code Here

TOP

Related Classes of org.springframework.core.LocalVariableTableParameterNameDiscoverer$LocalVariableTableVisitor

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.