本文整理汇总了Java中org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.setLocations方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyPlaceholderConfigurer.setLocations方法的具体用法?Java PropertyPlaceholderConfigurer.setLocations怎么用?Java PropertyPlaceholderConfigurer.setLocations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
的用法示例。
在下文中一共展示了PropertyPlaceholderConfigurer.setLocations方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
/**
* Property placeholder configurer.
*
* @return the property placeholder configurer
*/
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
final List<Resource> resourceLst = new ArrayList<>();
resourceLst.add(new ClassPathResource("/hibernateTest.properties"));
resourceLst.add(new ClassPathResource("/config.properties"));
resourceLst.add(new ClassPathResource("/bankRemittance.properties"));
resourceLst.add(new ClassPathResource("/firebaseMessaging.properties"));
resourceLst.add(new ClassPathResource("/firebaseWeb.properties"));
resourceLst.add(new ClassPathResource("/paypal.properties"));
resourceLst.add(new ClassPathResource("/recaptcha.properties"));
//initializeFirebase("configFirebase", "/members-firebase-adminsdk.json");
ppc.setLocations(resourceLst.toArray(new Resource[] {}));
return ppc;
}
示例2: conversionService
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
/**
* Load the properties files used in application contexts here
*
* @return the initialized instance of the PropertyPlaceholderConfigurer class
*/
@Bean(name="properties")
@Scope(BeanDefinition.SCOPE_SINGLETON)
public PropertyPlaceholderConfigurer conversionService() {
PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
Resource resource1 = new ClassPathResource("application_file_1.properties");
Resource resource2 = new ClassPathResource("application_file_2.properties");
configurer.setLocations(resource1, resource2);
return configurer;
}
示例3: newApplicationConf
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
public static PropertyPlaceholderConfigurer newApplicationConf(boolean searchSystemEnvironment, String... locations){
Assert.notEmpty(locations);
PropertyPlaceholderConfigurer ppc = new JFishPropertyPlaceholder();
ppc.setIgnoreResourceNotFound(true);
ppc.setIgnoreUnresolvablePlaceholders(true);
ppc.setSearchSystemEnvironment(searchSystemEnvironment);
List<Resource> resources = new ArrayList<Resource>();
for(String path : locations){
resources.add(new ClassPathResource(path));
}
ppc.setLocations(resources.toArray(new Resource[resources.size()]));
return ppc;
}
示例4: propertyConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public PropertyPlaceholderConfigurer propertyConfigurer()
throws IOException {
PropertyPlaceholderConfigurer props = new PropertyPlaceholderConfigurer();
props.setLocations(new Resource[] { new ClassPathResource(
"akka/application.remote.conf") });
return props;
}
示例5: properties
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
//Reading of properties filea - ClassPath resources - for some JVM installations works in one place only (..)
public static PropertyPlaceholderConfigurer properties() {
LOGGER.info("PropertyPlaceholderConfigurer configuring ClassPathResource -list of *.properties files");
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ClassPathResource[] resources = new ClassPathResource[ ] {
new ClassPathResource("persistence.properties")
};
ppc.setLocations( resources );
ppc.setIgnoreUnresolvablePlaceholders( true );
LOGGER.info("PropertyPlaceholderConfigurer configuring ClassPathResource -number of files="+resources.length);
return ppc;
}
示例6: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setLocations(new Resource[]{
new ClassPathResource("/app.properties")
});
return ppc;
}
示例7: propertyPlaceholderConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
ppc.setLocations(new Resource[]{
new ClassPathResource("/app.test.properties")
});
return ppc;
}
示例8: propertyConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyConfigurer() throws IOException {
PropertyPlaceholderConfigurer props = new PropertyPlaceholderConfigurer();
props.setLocations(new Resource[] { new ClassPathResource("db.properties") });
return props;
}
示例9: propertyConfigurer
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; //导入方法依赖的package包/类
@Bean
public static PropertyPlaceholderConfigurer propertyConfigurer() throws IOException {
PropertyPlaceholderConfigurer props = new PropertyPlaceholderConfigurer();
props.setLocations(new Resource[] {new ClassPathResource("application.properties")});
return props;
}