PropertiesLoaderConfigurer.java 文件源码

java
阅读 14 收藏 0 点赞 0 评论 0

项目:ZombieLib2 作者:
@Override
public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException {
    super.postProcessBeanFactory(beanFactory);

    final StandardServletEnvironment propertySources =
            (StandardServletEnvironment) super.getAppliedPropertySources().get(ENVIRONMENT_PROPERTIES).getSource();

    propertySources.getPropertySources().forEach(propertySource -> {
        if (propertySource.getSource() instanceof Map) {
            // it will print systemProperties, systemEnvironment, application.properties and other overrides of
            // application.properties
            log.trace("#######" + propertySource.getName() + "#######");


            //noinspection unchecked
            ((Map) propertySource.getSource()).forEach((key, value) -> log.trace(key+"="+value));
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号