Examples of BeanDefinition


Examples of org.springframework.beans.factory.config.BeanDefinition

        String args = DomUtils.getChildElementValueByTagName(child, "arguments");

        if (args != null) {
          // create linked properties
          BeanDefinition params = BeanDefinitionBuilder.genericBeanDefinition(LinkedProperties.class).addConstructorArgValue(args).getBeanDefinition();
          def.getConstructorArgumentValues().addIndexedArgumentValue(1, params);
        }
        defs.add(def);
      }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    }

    Object script = null;
    if (nestedScript != null) {
      // parse the script definition
      BeanDefinition nested = new ScriptParser().parse(nestedScript, parserContext);
      if (StringUtils.hasText(scope)) {
        nested.setScope(scope);
      }
      script = nested;
    }
    else {
      script = new RuntimeBeanReference(attribute);
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

      builder.addPropertyValue("extension", StringUtils.getFilenameExtension(location));
    }

    // parse properties
    BeanDefinition bd = new GenericBeanDefinition();
    parserContext.getDelegate().parsePropertyElements(element, bd);

    ManagedMap<String, Object> args = new ManagedMap<String, Object>();
    List<PropertyValue> list = bd.getPropertyValues().getPropertyValueList();

    for (PropertyValue pv : list) {
      args.put(pv.getName(), pv.getValue());
    }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

                def.getConstructorArgumentValues().addIndexedArgumentValue(0, resource, Resource.class.getName());
                String args = DomUtils.getChildElementValueByTagName(child, "arguments");

                if (args != null) {
                    BeanDefinition params = BeanDefinitionBuilder.genericBeanDefinition(LinkedProperties.class).addConstructorArgValue(args).getBeanDefinition();
                    def.getConstructorArgumentValues().addIndexedArgumentValue(1, params);
                }
                defs.add(def);

            }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

     * Adds the validation configuration files to the list already held in the validator factory bean configuration.
     * @param configurableListableBeanFactory the bean factory
     */
    public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) {
        if (configurableListableBeanFactory.containsBean(validatorFactoryBeanName)) {
            BeanDefinition validatorFactoryBeanDefinition =
                    configurableListableBeanFactory.getBeanDefinition(validatorFactoryBeanName);
            MutablePropertyValues propertyValues = validatorFactoryBeanDefinition.getPropertyValues();
            PropertyValue propertyValue = propertyValues.getPropertyValue("validationConfigLocations");

            //value is expected to be a list.
            List existingValidationConfigLocations = (List) propertyValue.getValue();
            existingValidationConfigLocations.addAll(validationConfigLocations);
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    if (childElements != null && childElements.size() == 1) {
      Element beanElement = childElements.get(0);
      BeanDefinitionParserDelegate delegate = parserContext.getDelegate();
      BeanDefinitionHolder bdHolder = delegate.parseBeanDefinitionElement(beanElement);
      bdHolder = delegate.decorateBeanDefinitionIfRequired(beanElement, bdHolder);
      BeanDefinition inDef = bdHolder.getBeanDefinition();
      innerComponentDefinition = new BeanComponentDefinition(inDef, bdHolder.getBeanName());
    }
    String ref = element.getAttribute(REF_ATTRIBUTE);
    if (StringUtils.hasText(ref) && innerComponentDefinition != null) {
      parserContext.getReaderContext().error(
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    if (null == context || !REPOSITORY_TYPE.isAssignableFrom(beanClass)) {
      return null;
    }

    BeanDefinition definition = context.getBeanDefinition(beanName);
    PropertyValue value = definition.getPropertyValues().getPropertyValue("repositoryInterface");

    Class<?> resolvedBeanClass = cache.get(beanName);

    if (cache.containsKey(beanName)) {
      return cache.get(beanName);
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    reader.loadBeanDefinitions(getPopulatorResource());

    BeanDefinition definition = beanFactory.getBeanDefinition("jackson2-populator");
    assertThat(definition, is(notNullValue()));

    Object bean = beanFactory.getBean("jackson2-populator");
    assertThat(bean, is(instanceOf(ResourceReaderRepositoryPopulator.class)));
    Object resourceReader = ReflectionTestUtils.getField(bean, "reader");
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

    DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);
    reader.loadBeanDefinitions(getPopulatorResource());

    BeanDefinition definition = beanFactory.getBeanDefinition("xml-populator");
    assertThat(definition, is(notNullValue()));

    Object bean = beanFactory.getBean("xml-populator");
    assertThat(bean, is(instanceOf(ResourceReaderRepositoryPopulator.class)));
    Object resourceReader = ReflectionTestUtils.getField(bean, "reader");
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanDefinition

      if (!(item instanceof BeanDefinition)) {
        return false;
      }

      BeanDefinition definition = (BeanDefinition) item;
      return definition.getBeanClassName().equals(expectedType.getName());
    }
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.