Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.ConstructorArgumentValues.addGenericArgumentValue()


          } else {
            if (log.isDebugEnabled()) {
              log.debug("constructor-arg added without index");
            }

            constructorValues
                .addGenericArgumentValue(constructorValue);
          }
        } else if (log.isWarnEnabled()) {
          log
              .warn("contructor-arg value is null; could not be added");
View Full Code Here


        }
        // constructorArgs
        else if (CONSTRUCTOR_ARGS.equals(property) && newValue instanceof List<?>) {
            ConstructorArgumentValues cav = new ConstructorArgumentValues();
            for (Object e : (List<?>)newValue) {
                cav.addGenericArgumentValue(e);
            }
            bd.setConstructorArgumentValues(cav);
        }
        // destroyMethod
        else if (DESTROY_METHOD.equals(property)) {
View Full Code Here

    protected AbstractBeanDefinition createBeanDefinition() {
        AbstractBeanDefinition bd = new GenericBeanDefinition();
        if (!constructorArgs.isEmpty()) {
            ConstructorArgumentValues cav = new ConstructorArgumentValues();
            for (Object constructorArg : constructorArgs) {
                cav.addGenericArgumentValue(constructorArg);
            }
            bd.setConstructorArgumentValues(cav);
        }
        bd.setBeanClass(clazz);
        bd.setScope(singleton ? AbstractBeanDefinition.SCOPE_SINGLETON : AbstractBeanDefinition.SCOPE_PROTOTYPE);
View Full Code Here

        final RootBeanDefinition pointcut;

        if (pointcutMatchRegex.length == 0 && pointcutNoMatchRegex.length == 0) {
            pointcut = new RootBeanDefinition(GeDAMethodMatcherPointcut.class);
            final ConstructorArgumentValues constructorArgs = pointcut.getConstructorArgumentValues();
            constructorArgs.addGenericArgumentValue(resolver);
        } else {
            pointcut = new RootBeanDefinition(GeDAMethodRegExMatcherPointcut.class);           
            final ConstructorArgumentValues constructorArgs = pointcut.getConstructorArgumentValues();
            constructorArgs.addGenericArgumentValue(resolver);
            final MutablePropertyValues propertyValues = pointcut.getPropertyValues();
View Full Code Here

            final ConstructorArgumentValues constructorArgs = pointcut.getConstructorArgumentValues();
            constructorArgs.addGenericArgumentValue(resolver);
        } else {
            pointcut = new RootBeanDefinition(GeDAMethodRegExMatcherPointcut.class);           
            final ConstructorArgumentValues constructorArgs = pointcut.getConstructorArgumentValues();
            constructorArgs.addGenericArgumentValue(resolver);
            final MutablePropertyValues propertyValues = pointcut.getPropertyValues();
            if (pointcutMatchRegex.length > 0) {
                propertyValues.addPropertyValue("patterns", pointcutMatchRegex);
            }
            if (pointcutNoMatchRegex.length > 0) {
View Full Code Here

  @Test
  public void testAutowiredFieldWithSingleNonQualifiedCandidate() {
    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues cavs = new ConstructorArgumentValues();
    cavs.addGenericArgumentValue(JUERGEN);
    RootBeanDefinition person = new RootBeanDefinition(Person.class, cavs, null);
    context.registerBeanDefinition(JUERGEN, person);
    context.registerBeanDefinition("autowired",
        new RootBeanDefinition(QualifiedFieldTestBean.class));
    AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
View Full Code Here

  @Test
  public void testAutowiredMethodParameterWithSingleNonQualifiedCandidate() {
    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues cavs = new ConstructorArgumentValues();
    cavs.addGenericArgumentValue(JUERGEN);
    RootBeanDefinition person = new RootBeanDefinition(Person.class, cavs, null);
    context.registerBeanDefinition(JUERGEN, person);
    context.registerBeanDefinition("autowired",
        new RootBeanDefinition(QualifiedMethodParameterTestBean.class));
    AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
View Full Code Here

  @Test
  public void testAutowiredConstructorArgumentWithSingleNonQualifiedCandidate() {
    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues cavs = new ConstructorArgumentValues();
    cavs.addGenericArgumentValue(JUERGEN);
    RootBeanDefinition person = new RootBeanDefinition(Person.class, cavs, null);
    context.registerBeanDefinition(JUERGEN, person);
    context.registerBeanDefinition("autowired",
        new RootBeanDefinition(QualifiedConstructorArgumentTestBean.class));
    AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
View Full Code Here

  @Test
  public void testAutowiredFieldWithSingleQualifiedCandidate() {
    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues cavs = new ConstructorArgumentValues();
    cavs.addGenericArgumentValue(JUERGEN);
    RootBeanDefinition person = new RootBeanDefinition(Person.class, cavs, null);
    person.addQualifier(new AutowireCandidateQualifier(TestQualifier.class));
    context.registerBeanDefinition(JUERGEN, person);
    context.registerBeanDefinition("autowired", new RootBeanDefinition(QualifiedFieldTestBean.class));
    AnnotationConfigUtils.registerAnnotationConfigProcessors(context);
View Full Code Here

  @Test
  public void testAutowiredMethodParameterWithSingleQualifiedCandidate() {
    GenericApplicationContext context = new GenericApplicationContext();
    ConstructorArgumentValues cavs = new ConstructorArgumentValues();
    cavs.addGenericArgumentValue(JUERGEN);
    RootBeanDefinition person = new RootBeanDefinition(Person.class, cavs, null);
    person.addQualifier(new AutowireCandidateQualifier(TestQualifier.class));
    context.registerBeanDefinition(JUERGEN, person);
    context.registerBeanDefinition("autowired",
        new RootBeanDefinition(QualifiedMethodParameterTestBean.class));
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.