hmm, that's a good point- I'm not sure why Properties wasn't created in a more scalable way (short of carelessness), so that you can specify reserved characters, or at least over-ride its parsing logic more easily. From a time-to-market perspective, it might be easier to just write a parsing tool that changes all of your special comment characters into comment characters supported by the java.util.Properties API (rather then writing your own load logic for the properties file) ... I would guess (pure guess) that Properties adds each key/value via inherited method put(key, value) so you could write a subclass that extends Properties and over-rides that method, so that it does not actually put keys with the reserved characters into the Map. That might be the easiest solution I can envision, you sould just do some thing like,
public void put(Object key, Object value) {
if ((key instanceof java.lang.String) && (key.startsWith(RESERVED_STRING)) {
//don't add it
return;
}
else {
super.put(key, value);
}
}
The only problem is, you're relying on Properties to use that method when adding to the underlying Map (which may not be the case now or in the future) ... .... maybe some one else has an easier answer.