commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [collections] BeanMap and write-only properties
Date Sun, 02 Mar 2003 19:23:51 GMT

Java Beans allows for write-only bean properties (see chapter 8.3.1 of the Java
Beans specification, 'Simple properties'). With class BeanMap it is possible to
handle write-only properties as well.

On the other hand, the #keySet method of a BeanMap instance doesn't  care about
write-only properties, because the key set is computed from the internal set of
read methods, and there is no read method for a write-only property. Moreover,
the new value parameter of the protected method #firePropertyChange will always
be null if write-only properties are involved, because the new value is computed
by the use of the read method.

The usage of write-only properties is very rare (e.g., see and  I
recommend to introduce a comment within methods like #keySet:

"Write-only properties aren't included in the returned set of property names,
although it is possible to set their value and to get their type."


Belgien, Italien, Portugal,... Mit WEB.DE FreeMail koennen Sie in all
diese Laender SMS senden.

View raw message