Java BeanUtils Tutorial
Standard JavaBeans
Dynamic Beans (DynaBeans)
Data Type Conversions
Utility Objects & Classes
Collections
Java BeanUtils Useful Resources
Selected Reading
Standard JavaBeans
- Suppressing Properties
- Customizing Introspection
- Nested Property Access
- Basic Property Access
- Background
Dynamic Beans (DynaBeans)
Data Type Conversions
Utility Objects & Classes
Collections
Java BeanUtils Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Operating On Collections
Java BeanUtils - Operating On Collections
Description
The Commons-Collections are build upon interfaces, implementations and utipties. It contains Closure interface in the code that can be appped on the arbitrary input object and code permits to apply Closures to contents of collection. There is Closure called BeanPropertyValueChangeClosure sets specified property to specified value. This value can be combined with commons-collections in which all the beans will have specified property to specified value in the collection.
For instance, you can set the myCar property to TRUE for entire collection as shown below:
//creating the closure BeanPropertyValueChangeClosure closure = new BeanPropertyValueChangeClosure( "myCar", Boolean.TRUE ); //updating the Collection CollectionUtils.forAllDo( myCollection, closure );Advertisements