DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27965>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27965

Writing to a mapped property requires a setter for a map, but never uses it





------- Additional Comments From [EMAIL PROTECTED]  2004-08-01 02:37 -------
One reason: the example given does not conform to the Java Beans spec.  Property
has to have *both* getter and setter.

However, statements on the user maillist indicate that mapped properties (which
have no direct correspondence within the Java Beans spec) are supposed to work
like indexed properties.  So you code:

public Object getXxx(String key)
public void setXxx(String key, Object value)
public Map getXxx()
public void setXxx(Map map)

and BeanUtils.copyProperties(bean, myprops) is supposed to transform any
property in myprops of the form 'xxx(akey)=avalue' into a call to
setXxx("akey","avalue").  But it does not; instead getXxx():Map is called and
the property is set directly on the map.  If you drop the getXxx() and
setXxx(Map) methods, the property gets skipped.  This is apparently due to the
MappedPropertyDescriptor returning setXxx(String,Object) from
getMappedWriteMethod but not from getWriteMethod....therefore, isWriteable check
in PropertyUtils fails and nother occurs.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to