Examples of PropertyValue


Examples of org.springframework.beans.PropertyValue

                continue;
            }

            try {
                Collection<?> ids = null;
                PropertyValue pv = def.getPropertyValues().getPropertyValue(idsProperty);
               
                if (pv != null) {
                    Object value = pv.getValue();
                    if (!(value instanceof Collection)) {
                        throw new RuntimeException("The property " + idsProperty + " must be a collection!");
                    }

                    if (value instanceof Mergeable) {
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    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.PropertyValue

    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.PropertyValue

    {
        if(registrationPropertyValues == null)
        {
            return null;
        }
        PropertyValue propertyValue = registrationPropertyValues.getPropertyValue(propertyName);
        if(propertyValue == null)
        {
            return null;
        }
        Object value = propertyValue.getValue();
        if(value == null)
        {
            return null;
        }
        if(value.getClass() == String.class)
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    @Test
    public void testFeatureServiceFactoryProperties() {
        BeanDefinition beanDefinition = context.getBeanDefinition("featureServiceFactory");

        // Test ContextProviders setup
        PropertyValue contextProvidersProperty = beanDefinition.getPropertyValues().getPropertyValue("contextProviders");
        assertNotNull(contextProvidersProperty);
        assertTrue(contextProvidersProperty.getValue() instanceof List);
        List contextProvidersList = ((List)contextProvidersProperty.getValue());
        assertEquals(2, contextProvidersList.size());
       
        assertTrue(contextProvidersList.get(0) instanceof BeanDefinitionHolder);
        assertEquals(SystemPropertiesContextProvider.class.getName(), ((BeanDefinitionHolder)contextProvidersList.get(0)).getBeanDefinition().getBeanClassName());
       
        assertTrue(contextProvidersList.get(1) instanceof BeanReference);
        assertEquals("contextProviderBean", ((BeanReference)contextProvidersList.get(1)).getBeanName());

        // Test PropertyReaders setup
        PropertyValue propertyReadersProperty = beanDefinition.getPropertyValues().getPropertyValue("propertyReaders");
        assertNotNull(propertyReadersProperty);
        assertTrue(propertyReadersProperty.getValue() instanceof List);
        List propertyReadersList = ((List)propertyReadersProperty.getValue());
        assertEquals(2, propertyReadersList.size());
       
        assertTrue(propertyReadersList.get(0) instanceof BeanDefinitionHolder);
        assertEquals(XmlPropertyReader.class.getName(), ((BeanDefinitionHolder)propertyReadersList.get(0)).getBeanDefinition().getBeanClassName());
       
        assertTrue(propertyReadersList.get(1) instanceof BeanReference);
        assertEquals("propertyReaderBean", ((BeanReference)propertyReadersList.get(1)).getBeanName());
       
        // Test properties setup
        PropertyValue propertiesProperty = beanDefinition.getPropertyValues().getPropertyValue("properties");
        assertNotNull(propertiesProperty);
        assertTrue(propertiesProperty.getValue() instanceof Properties);
        Properties properties = ((Properties)propertiesProperty.getValue());
        assertEquals(1, properties.size());
       
        for(Map.Entry entry : properties.entrySet()) {
            assertEquals("aa", ((TypedStringValue)entry.getKey()).getValue());
            assertEquals("bb", ((TypedStringValue)entry.getValue()).getValue());
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    public void testFeatureServiceFactoryPropertiesMising() {
        setupContext("test-feature-service-context-empty.xml");
        BeanDefinition beanDefinition = context.getBeanDefinition("featureServiceFactory");

        // Test ContextProviders setup
        PropertyValue contextProvidersProperty = beanDefinition.getPropertyValues().getPropertyValue("contextProviders");
        assertNull(contextProvidersProperty);

        // Test PropertyReaders setup
        PropertyValue propertyReadersProperty = beanDefinition.getPropertyValues().getPropertyValue("propertyReaders");
        assertNull(propertyReadersProperty);
       
        // Test properties setup
        PropertyValue propertiesProperty = beanDefinition.getPropertyValues().getPropertyValue("properties");
        assertNull(propertiesProperty);
    }
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    public void testFeatureServiceFactoryPropertiesWithPropChildren() {
        setupContext("test-feature-service-context-no-prop-children.xml");
        BeanDefinition beanDefinition = context.getBeanDefinition("featureServiceFactory");

        // Test ContextProviders setup
        PropertyValue contextProvidersProperty = beanDefinition.getPropertyValues().getPropertyValue("contextProviders");
        assertNull(contextProvidersProperty);

        // Test PropertyReaders setup
        PropertyValue propertyReadersProperty = beanDefinition.getPropertyValues().getPropertyValue("propertyReaders");
        assertNull(propertyReadersProperty);
       
        // Test properties setup
        PropertyValue propertiesProperty = beanDefinition.getPropertyValues().getPropertyValue("properties");
        assertNull(propertiesProperty);
    }
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    public void testFeatureServiceFactoryPropertiesWithEnvironment() {
        setupContext("test-feature-service-context-with-env.xml");
        BeanDefinition beanDefinition = context.getBeanDefinition("featureServiceFactory");

        // Test ContextProviders setup
        PropertyValue environmentProperty = beanDefinition.getPropertyValues().getPropertyValue("environment");
        assertNotNull(environmentProperty);
       
        assertTrue(environmentProperty.getValue() instanceof BeanReference);
        assertEquals("environmentBean", ((BeanReference)environmentProperty.getValue()).getBeanName());
    }
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    AbstractBeanDefinition definition = (AbstractBeanDefinition) registry
        .getBeanDefinition(beanName);

    ConfigAssert.assertBeanDefinitionWrapsClass(definition, targetClass);

    PropertyValue expected = new PropertyValue("cachingAttributeSource",
        new RuntimeBeanReference(beanName));

    ConfigAssert.assertPropertyIsPresent(propertyValues, expected);
  }
View Full Code Here

Examples of org.springframework.beans.PropertyValue

    AbstractBeanDefinition definition = (AbstractBeanDefinition) registry
        .getBeanDefinition(beanName);

    ConfigAssert.assertBeanDefinitionWrapsClass(definition, targetClass);

    PropertyValue expected = new PropertyValue("flushingAttributeSource",
        new RuntimeBeanReference(beanName));

    ConfigAssert.assertPropertyIsPresent(propertyValues, expected);
  }
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.