Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Beans > getNestedProper...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1322 of 1363
Post > Topic >>

getNestedProperty problem with BeanUtils

by kev.grindley@[EMAIL PROTECTED] Sep 12, 2007 at 05:40 AM

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.
 




 1 Posts in Topic:
getNestedProperty problem with BeanUtils
kev.grindley@[EMAIL PROTE  2007-09-12 05:40:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 5 14:01:49 CDT 2008.