org.springframework.context.support.PropertySourcesPlaceholderConfigurer#setNullValue ( )源码实例Demo

下面列出了org.springframework.context.support.PropertySourcesPlaceholderConfigurer#setNullValue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: molgenis   文件: MolgenisWebAppConfig.java
@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;
}
 
@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;
}
 
源代码3 项目: molgenis   文件: PlatformITConfig.java
@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;
}
 
@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;
}
 
源代码5 项目: CogStack-Pipeline   文件: JobConfiguration.java
@Bean
public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() {
    PropertySourcesPlaceholderConfigurer props = new PropertySourcesPlaceholderConfigurer();
    props.setNullValue("");
    return props;
}
 
源代码6 项目: chassis   文件: BootstrapConfiguration.java
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceHolderConfigurer() {
    PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
    propertySourcesPlaceholderConfigurer.setNullValue("null");
    return propertySourcesPlaceholderConfigurer;
}