On 6/1/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
Next question :) Because it's related to what I'm doing with the first, I figured go with the same thread... I have an instance of the Test class, which contains the following: private List children; public void setChildren(final List inChildren) { children = inChildren; } public List getChildren() { return children; } Then, in a class trying to populate this, I have: Object obj = new Test(); List fieldValues = new ArrayList(); fieldValues.add("test"); PropertyUtils.setIndexedProperty(obj, "children", fieldValues); When I try it, I get: java.lang.IllegalArgumentException: Invalid indexed property 'children' Not sure what's going on... since this is the version of setIndexedProperty() without the index, I assume it's going to call setChildren(List) and not be looking for the setter with the index, correct? Thanks!
Correct. It's a limitation of BeanUtils that it does not try to use the "indexed" setters if they exist. It only deals with the actual List or array property as a whole. Frank Craig