org.springframework.rules.closure.support
Class IfBlock
java.lang.Object
org.springframework.rules.closure.support.AlgorithmsAccessor
org.springframework.rules.closure.support.AbstractClosure
org.springframework.rules.closure.support.Block
org.springframework.rules.closure.support.IfBlock
- All Implemented Interfaces:
- Serializable, Closure
public class IfBlock
- extends Block
Only execute the specified closure if a provided constraint is also true.
- Author:
- Keith Donald
- See Also:
- Serialized Form
Method Summary |
protected void |
handle(Object argument)
Only invoke the wrapped closure against the provided argument if the
constraint permits, else take no action. |
Methods inherited from class org.springframework.rules.closure.support.Block |
call |
Methods inherited from class org.springframework.rules.closure.support.AlgorithmsAccessor |
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IfBlock
public IfBlock(Constraint constraint,
Closure closure)
- Constructor.
- Parameters:
constraint
- Constraint to test against.closure
- closure to be executed if object passes the test.
handle
protected void handle(Object argument)
- Only invoke the wrapped closure against the provided argument if the
constraint permits, else take no action.
- Specified by:
handle
in class Block
- Parameters:
argument
- the argument to process
Copyright © 2004-2009 The Spring Framework. All Rights Reserved.