com.sc.utils.spring.PropertiesUtils Maven / Gradle / Ivy
package com.sc.utils.spring;
import org.springframework.context.EmbeddedValueResolverAware;
import org.springframework.stereotype.Component;
import org.springframework.util.StringValueResolver;
@Component
public class PropertiesUtils implements EmbeddedValueResolverAware {
private StringValueResolver stringValueResolver;
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
stringValueResolver = resolver;
}
public String getPropertiesValue(String name){
return stringValueResolver.resolveStringValue(name);
}
}