How do I set indexed property value of a bean?
Category: commons.beanutils, viewed: 734 time(s).
In this example we display how to set the value of an indexed property. In the code below we modified the value of an array type. We'll change the second colors of MyBean's colors property.
We do it in the same way as using the PropertyUtils.setSimpleProperty method. For indexed property we use the PropertyUtils.setIndexedProperty method and passes four arguments, they are the instance of bean to be manipulated, the indexed property name, the index to be changes and the finally the new value.
Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
Related Examples
|
|
