【发布时间】:2020-05-06 16:25:07
【问题描述】:
我有一个 Spring 4.3 自定义 PropertyPlaceholderConfigurer,它在注入之前对从属性文件中读取的值进行额外处理:
public class MyPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{
@Override
protected String convertPropertyValue(final String originalValue) { ... }
@Override
protected String resolveSystemProperty(final String key) {
return convertPropertyValue(super.resolveSystemProperty(key));
}
}
我的问题是注解注入属性值的 bean 字段,例如。 @Value("${some_property}"),实际上是从属性源读取的原始值注入的,没有经过我的自定义处理。
【问题讨论】:
标签: java spring property-placeholder