Hi
I'm encountering a problem with BeanUtils and specifically the
getNestedProperty method of the PropertyUtils class.
I have an object defined like this (names changed):
public class FredBean {
String _id
Date _startDate;
Date _endDate;
com.fred.Items _items;
public String getId() { return _id; }
etc ...
}
com.fred.Items is like this:
public class Items {
java.util.List _itemList;
public List getItemList() { return _itemList; }
...
}
My application attempts to derive the Items as follows:
MyBeanUtils.getPropertyUtils().getNestedProperty(FredBeanInstance,
"Id.ItemList");
This fails with a java.lang.NoSuchMethodException. Unknown property
'Id'.
I don't understand this as this is directly analogous to the examples
provided in the BeanUtils documentation:
http://commons.apache.org/beanutils/commons-beanutils-1.7.0/docs/api/org/apache/commons/beanutils/package-summary.html#standard.nested
.... and there are getters for the fields concerned.
Am I missing osmething obvious? Any help gratefully received.
Thanks.