I'm looking to centralize access to all of my property values so that I can do things like make sure everything uses the same name for properties, the same default values, etc. I've created a class to centralize all of this, but I'm not sure how the classes that need access to these values should get them, since you can't autowire Strings.
My class is something like this:
@Configuration
public class SpringConfig {
@Autowired
@Value("${identifier:asdf1234}")
public String identifier;
}
Where I might use it in multiple classes
public class Foo {
@Autowired
private String theIdentifier;
}
public class Bar {
@Autowired
private String anIdentifier;
}