[Index]
bus:collect
A component that collects beans in a list. Additionally, this component may
be used in the middle of a bus:bus so can act as a Wire Tap.
Property Summary
| beans |
The same as list. |
| count |
Count of items collected. |
| keyMapper |
A function that will extract a key from an item. |
| list |
The collected items as list container. |
| map |
The collected items as a map container. |
| name |
The name of this component. |
| output |
An output stream that items will be written to as strings. |
| to |
The next component in a bus. |
| valueMapper |
A function that will extract a value from an item to put in the map. |
Example Summary
Property Detail
beans
| Access | READ_ONLY |
| Required | Read only. |
The same as list. Prefer list, will be deprecated in future versions.
count
| Access | READ_ONLY |
| Required | R/O. |
Count of items collected.
keyMapper
| Configured By | ELEMENT |
| Access | READ_WRITE |
| Required | No. |
A function that will extract a key from an item. If this property is set, items will
be available as a map, not a list.
list
| Access | READ_ONLY |
| Required | Read only. |
The collected items as list container. Conversions exist so that this list
property can be used as a list or the values can be accessed using an indexed accessor on the value property.
map
| Access | READ_ONLY |
| Required | Read only. |
The collected items as a map container. Conversions exist so that this map
property can be used as a map or the values can be accessed using a mapped accessor on the value property.
name
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The name of this component.
output
| Configured By | ELEMENT |
| Access | READ_WRITE |
| Required | No. |
An output stream that items will be written to as strings.
to
| Configured By | ELEMENT |
| Access | READ_WRITE |
| Required | No. |
The next component in a bus. Set automatically in a
bus:bus.
valueMapper
| Configured By | ELEMENT |
| Access | READ_WRITE |
| Required | No. |
A function that will extract a value from an item to put in the map. If this property
is set, but bus:collect is not, then it will be silently ignored.
Examples
Example 1
There are many examples elsewhere.
(c) R Gordon Ltd 2005 - Present