java.util.Properties implements the Map interface so you can do everything that this interface offers with it. To allow value to represent a reference to an other key you could wrap the code for getting the value in such a ways that it check whether the value is actually key and then return the value that is mapped by that key.
so you could implement something like this:
String value1 = p.getProperty("var1");
while(p.containsKey(value1)) {
value1 = p.getProperty(value1);
}
better: add a prefix - $
for example - to value to identify a reference, only if present then resolve:
String value1 = p.getProperty("var1");
while(value1.startsWith("$")) {
value1 = p.getProperty(value1.substring(1));
}
A good way for wrapping the retrieve-code is by extending the Properties
class and override the method getProperty
.
For org.springframework.context.support.ReloadableResourceBundleMessageSource
you could extend it, override which ever methods you want and configure spring to inject your version of the class.