Java Code Examples for org.springframework.context.support.PropertySourcesPlaceholderConfigurer#setNullValue()

The following examples show how to use org.springframework.context.support.PropertySourcesPlaceholderConfigurer#setNullValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MolgenisWebAppConfig.java    From molgenis with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Bean
public static PropertySourcesPlaceholderConfigurer properties() throws IOException {
  AppDataRootInitializer.init();

  PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
  Resource[] resources =
      new Resource[] {
        new FileSystemResource(
            AppDataRootProvider.getAppDataRoot().toString()
                + File.separator
                + "molgenis-server.properties"),
        new ClassPathResource("/molgenis.properties")
      };
  pspc.setLocations(resources);
  pspc.setFileEncoding("UTF-8");
  pspc.setIgnoreUnresolvablePlaceholders(true);
  pspc.setIgnoreResourceNotFound(true);
  pspc.setNullValue("@null");
  return pspc;
}
 
Example 2
Source File: CoderadarApplicationContextConfiguration.java    From coderadar with MIT License 5 votes vote down vote up
@Bean
public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
  PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
  // we want to resolve configuration parameters to NULL so we can give the user a meaningful log
  // output when
  // some parameter is invalid when starting the application.
  configurer.setNullValue("");
  return configurer;
}
 
Example 3
Source File: PlatformITConfig.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public static PropertySourcesPlaceholderConfigurer properties() {
  PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
  Resource[] resources = new Resource[] {new ClassPathResource("/conf/molgenis.properties")};
  pspc.setLocations(resources);
  pspc.setFileEncoding("UTF-8");
  pspc.setIgnoreUnresolvablePlaceholders(true);
  pspc.setIgnoreResourceNotFound(true);
  pspc.setNullValue("@null");
  return pspc;
}
 
Example 4
Source File: AbstractMolgenisIntegrationTests.java    From molgenis with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public static PropertySourcesPlaceholderConfigurer properties() {
  PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer();
  Resource[] resources = new Resource[] {new ClassPathResource("/conf/molgenis.properties")};
  pspc.setLocations(resources);
  pspc.setFileEncoding("UTF-8");
  pspc.setIgnoreUnresolvablePlaceholders(true);
  pspc.setIgnoreResourceNotFound(true);
  pspc.setNullValue("@null");
  return pspc;
}
 
Example 5
Source File: JobConfiguration.java    From CogStack-Pipeline with Apache License 2.0 4 votes vote down vote up
@Bean
public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() {
    PropertySourcesPlaceholderConfigurer props = new PropertySourcesPlaceholderConfigurer();
    props.setNullValue("");
    return props;
}
 
Example 6
Source File: BootstrapConfiguration.java    From chassis with Apache License 2.0 4 votes vote down vote up
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceHolderConfigurer() {
    PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    propertySourcesPlaceholderConfigurer.setNullValue("null");
    return propertySourcesPlaceholderConfigurer;
}