Jim Cheesman wrote:
> Sort of:
>
> /**
> * Creates an extended properties object from a Hashtable
> */
> public ExtendedProperties(ResourceBundle resourceBundle) {
> super();
> String key;
> Object value;
> for (Enumeration e = resourceBundle.getKeys() ; e.hasMoreElements() ;) {
> key = (String) e.nextElement();
> value = resourceBundle.getObject(key);
> put(key, value);
> }
> }
Exactly the sort of thing I had in mind. But a little more is needed if the fields are
to be split at comma markers (as
per usual ExtendedProperties behaviour). Just a tiny difference:
/**
* Creates an extended properties object from a ResourceBundle
*/
public ExtendedProperties(ResourceBundle resourceBundle) {
super();
for (Enumeration e = resourceBundle.getKeys() ; e.hasMoreElements() ;) {
String key = (String) e.nextElement();
Object value = resourceBundle.getObject(key);
addProperty(key, value);
}
}
I have an observation on the current (1.0) ExtendedProperties two-argument
constructor: it does not call 'super()'. Does
this matter?
Rick