[Index]
bus:filter
Filter out beans passing through the bus according to an java.util.function.Predicate.
Property Summary
blocked |
Number of items blocked by the predicate. |
name |
The name of this component. |
passed |
Number of items passing the predicate. |
predicate |
The predicate. |
to |
The next component in a bus. |
Example Summary
Property Detail
blocked
Access | READ_ONLY |
Required | Read only. |
Number of items blocked by the predicate.
name
Configured By | ATTRIBUTE |
Access | READ_WRITE |
Required | No. |
The name of this component.
passed
Access | READ_ONLY |
Required | Read only. |
Number of items passing the predicate.
predicate
Configured By | ELEMENT |
Access | READ_WRITE |
Required | Yes. |
The predicate.
to
Configured By | ELEMENT |
Access | READ_WRITE |
Required | No. |
The next component in a bus. Set automatically in a
bus:bus.
Examples
Example 1
Filter out Bananas.
<oddjob>
<job>
<bus:bus id="bean-bus" xmlns:bus="oddjob:beanbus">
<of>
<bus:driver>
<values>
<list>
<values>
<bean class="org.oddjob.beanbus.example.Fruit" quantity="42" type="Apple" price="25.5"/>
<bean class="org.oddjob.beanbus.example.Fruit" quantity="24" type="Banana" price="36.2"/>
<bean class="org.oddjob.beanbus.example.Fruit" quantity="15" type="Pear" price="40.4"/>
</values>
</list>
</values>
</bus:driver>
<bus:filter>
<predicate>
<bean class="org.oddjob.beanbus.example.RemoveFruit" remove="Banana"/>
</predicate>
</bus:filter>
<bus:collect id="results"/>
</of>
</bus:bus>
</job>
</oddjob>
(c) R Gordon Ltd 2005 - Present