当前位置: 首页>>代码示例>>Java>>正文


Java YamlPropertiesFactoryBean.afterPropertiesSet方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.config.YamlPropertiesFactoryBean.afterPropertiesSet方法的典型用法代码示例。如果您正苦于以下问题:Java YamlPropertiesFactoryBean.afterPropertiesSet方法的具体用法?Java YamlPropertiesFactoryBean.afterPropertiesSet怎么用?Java YamlPropertiesFactoryBean.afterPropertiesSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.config.YamlPropertiesFactoryBean的用法示例。


在下文中一共展示了YamlPropertiesFactoryBean.afterPropertiesSet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadYamlProperties

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
private static Map<Object, Object> loadYamlProperties(final Resource... resource) {
    final YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
    factory.setResolutionMethod(YamlProcessor.ResolutionMethod.OVERRIDE);
    factory.setResources(resource);
    factory.setSingleton(true);
    factory.afterPropertiesSet();
    return factory.getObject();
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:9,代码来源:CasCoreBootstrapStandaloneConfiguration.java

示例2: contributeDefaults

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
private static void contributeDefaults(Map<String, Object> defaults, Resource resource) {
	if (resource.exists()) {
		YamlPropertiesFactoryBean yamlPropertiesFactoryBean = new YamlPropertiesFactoryBean();
		yamlPropertiesFactoryBean.setResources(resource);
		yamlPropertiesFactoryBean.afterPropertiesSet();
		Properties p = yamlPropertiesFactoryBean.getObject();
		for (Object k : p.keySet()) {
			String key = k.toString();
			defaults.put(key, p.get(key));
		}
	}
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dashboard,代码行数:13,代码来源:DefaultEnvironmentPostProcessor.java

示例3: getDeploymentProperties

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
protected Map<String, String> getDeploymentProperties(@CliOption(key = {
		PROPERTIES_OPTION }, help = "the properties for this deployment") String deploymentProperties,
		@CliOption(key = {
				PROPERTIES_FILE_OPTION }, help = "the properties for this deployment (as a File)") File propertiesFile,
		int which) throws IOException {
	Map<String, String> propertiesToUse;
	switch (which) {
	case 0:
		propertiesToUse = DeploymentPropertiesUtils.parse(deploymentProperties);
		break;
	case 1:
		String extension = FilenameUtils.getExtension(propertiesFile.getName());
		Properties props = null;
		if (extension.equals("yaml") || extension.equals("yml")) {
			YamlPropertiesFactoryBean yamlPropertiesFactoryBean = new YamlPropertiesFactoryBean();
			yamlPropertiesFactoryBean.setResources(new FileSystemResource(propertiesFile));
			yamlPropertiesFactoryBean.afterPropertiesSet();
			props = yamlPropertiesFactoryBean.getObject();
		}
		else {
			props = new Properties();
			try (FileInputStream fis = new FileInputStream(propertiesFile)) {
				props.load(fis);
			}
		}
		propertiesToUse = DeploymentPropertiesUtils.convert(props);
		break;
	case -1: // Neither option specified
		propertiesToUse = new HashMap<>(1);
		break;
	default:
		throw new AssertionError();
	}
	return propertiesToUse;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:36,代码来源:AbstractStreamCommands.java

示例4: yamlPropertiesFactoryBean

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
@Bean
public YamlPropertiesFactoryBean yamlPropertiesFactoryBean() throws IOException {
    YamlPropertiesFactoryBean permissoes = new YamlPropertiesFactoryBean();
    permissoes.setResources(new ClassPathResource("permissoes.yaml"));
    permissoes.afterPropertiesSet();
    return permissoes;
}
 
开发者ID:servicosgovbr,项目名称:editor-de-servicos,代码行数:8,代码来源:WebMVCConfig.java

示例5: secretProperties

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
public static Properties secretProperties(String profile) {
    YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
    yaml.setResources(new ClassPathResource("config/application-" + profile + "-secret.yml"));
    yaml.afterPropertiesSet();
    return yaml.getObject();
}
 
开发者ID:esutoniagodesu,项目名称:egd-web,代码行数:7,代码来源:ArgumentResolver.java

示例6: loadProperty

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
private static YamlPropertiesFactoryBean loadProperty() {
    YamlPropertiesFactoryBean permissoes = new YamlPropertiesFactoryBean();
    permissoes.setResources(new ClassPathResource("permissoesTest.yaml"));
    permissoes.afterPropertiesSet();
    return permissoes;
}
 
开发者ID:servicosgovbr,项目名称:editor-de-servicos,代码行数:7,代码来源:GerenciadorPermissoesTest.java

示例7: loadProperties

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; //导入方法依赖的package包/类
private static Properties loadProperties(Resource resource) {
	YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean();
	yamlFactory.setResources(resource);
	yamlFactory.afterPropertiesSet();
	return yamlFactory.getObject();
}
 
开发者ID:spring-io,项目名称:initializr,代码行数:7,代码来源:InitializrMetadataBuilderTests.java


注:本文中的org.springframework.beans.factory.config.YamlPropertiesFactoryBean.afterPropertiesSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。