Package org.springframework.beans.factory.config

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


@ComponentScan(basePackageClasses = Application.class, excludeFilters = @Filter({Controller.class, Configuration.class}))
class ApplicationConfig {
 
  @Bean
  public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    ppc.setLocation(new ClassPathResource("/persistence.properties"));
    return ppc;
  }
View Full Code Here


@Import({ PersistenceConfig.class, SecurityConfig.class })
public class RootConfig {
 
  @Bean
  public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    ppc.setLocation(new ClassPathResource("/persistence.properties"));
    return ppc;
  }
View Full Code Here

     * PropertyPlaceholderConfigurer provides the values for the @Value annotations
     * @return
     */
    @Bean
    public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
        PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
        propertyPlaceholderConfigurer.setSystemPropertiesModeName("SYSTEM_PROPERTIES_MODE_OVERRIDE");
        propertyPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(false);
        propertyPlaceholderConfigurer.setIgnoreResourceNotFound(true);
        propertyPlaceholderConfigurer.setLocations(new Resource[] {
                new ClassPathResource("properties/default.properties"), new ClassPathResource("properties/local.properties")
        });
        return propertyPlaceholderConfigurer;
    }
View Full Code Here

                new ClassPathResource("META-INF/spring-jpa.xml"),
                new ClassPathResource("META-INF/spring-results.xml"), });
            xmlReader.setResourceLoader(ctx);
            xmlReader.setEntityResolver(new ResourceEntityResolver(ctx));

            PropertyPlaceholderConfigurer config = new PropertyPlaceholderConfigurer();
            config.setLocalOverride(true);
            config.setProperties(properties);
            config.setLocations(new ClassPathResource[] {
                new ClassPathResource("jpa.properties"),
                new ClassPathResource("archive-puids.properties"), });
           
            ctx.addBeanFactoryPostProcessor(config);
            ctx.refresh();
View Full Code Here

  @EnableReactor
  static class TestConfiguration {

    static @Bean
    public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
      return new PropertyPlaceholderConfigurer();
    }
View Full Code Here

  @ImportResource("file:../modules/sink/aggregate-counter/config/aggregate-counter.xml")
  public static class NullTimefieldAggregateCounterTestsConfig {

    @Bean
    public PropertyPlaceholderConfigurer ppc() {
      PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
      Properties props = new Properties();
      props.put("timeField", "null");
      props.put("dateFormat", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
      props.put("name", "foo");
      propertyPlaceholderConfigurer.setProperties(props);
      return propertyPlaceholderConfigurer;
    }
View Full Code Here

  @ImportResource("file:../modules/sink/aggregate-counter/config/aggregate-counter.xml")
  public static class WithTimefieldAggregateCounterTestsConfig {

    @Bean
    public PropertyPlaceholderConfigurer ppc() {
      PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
      Properties props = new Properties();
      props.put("timeField", "payload.ts");
      props.put("dateFormat", "dd/MM/yyyy");
      props.put("name", "foo");
      propertyPlaceholderConfigurer.setProperties(props);
      return propertyPlaceholderConfigurer;
    }
View Full Code Here

                    reader.setValidating(false);
                }
            };

            // Handle properties in configuration
            PropertyPlaceholderConfigurer configurator = new PropertyPlaceholderConfigurer();

            // convert dictionary to properties. Is there a better way?
            Properties props = new Properties();
            Enumeration<?> elements = properties.keys();
            while (elements.hasMoreElements()) {
                Object key = elements.nextElement();
                props.put(key, properties.get(key));
            }

            configurator.setProperties(props);
            configurator.setIgnoreUnresolvablePlaceholders(true);

            ctx.addBeanFactoryPostProcessor(configurator);

            ctx.refresh();
View Full Code Here

    String configurationDirectory = System.getProperty(CONFIG_DIR_PROPERTY);
    File propertiesFile = new File(configurationDirectory, PROPERTIES_FILE);
    final Resource[] resources = new Resource[] {
        new ClassPathResource(PROPERTIES_FILE),
        new FileSystemResource(propertiesFile) };
    PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
    ppc.setIgnoreUnresolvablePlaceholders(true);
    ppc.setIgnoreResourceNotFound(true);
    ppc.setLocations(resources);
    return ppc;
  }
View Full Code Here

     */
    public ActiveMQBeanFactory(String brokerName, Resource resource, BeanFactory parentBeanFactory) throws BeansException {
        super(parentBeanFactory);
        reader = createReader(brokerName);
        reader.loadBeanDefinitions(resource);
        PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
        configurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);
        configurer.postProcessBeanFactory(this);
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

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.