I had to subclass ResourceBundle due to our specific needs.
However, to override getKeys(), I am a bit in trouble. This getKeys needs to somehow concatenate from a map of underlying ResourceBundles. How can I do that?
Thanks
EDIT: While submitting I came across an idea. Basically we have for each of our Module a ResourceBundle, so my code looks like this so far:
public Enumeration<String> getKeys() {
ArrayList<String> keys = new ArrayList<String>();
for (Map.Entry<Module, ResourceBundle> entry : internalMap.entrySet()) {
Enumeration<String> tmp = entry.getValue().getKeys();
while (tmp.hasMoreElements()) {
String key = tmp.nextElement();
keys.add(key);
}
}
return Collections.enumeration(keys);
}
This is what we finally came up with. There is more code to it but thought it would be fair to share the basics. The solution follows a bit skaffman’s proposal.
Thanks to all contributions.