org.springframework.rules.closure.support
Class IfBlock

Show UML class diagram
java.lang.Object
  extended by org.springframework.rules.closure.support.AlgorithmsAccessor
      extended by org.springframework.rules.closure.support.AbstractClosure
          extended by org.springframework.rules.closure.support.Block
              extended by 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

Constructor Summary
IfBlock(Constraint constraint, Closure closure)
          Constructor.
 
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.AbstractClosure
forEach, forEach
 
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
 

Constructor Detail

IfBlock

public IfBlock(Constraint constraint,
               Closure closure)
Constructor.

Parameters:
constraint - Constraint to test against.
closure - closure to be executed if object passes the test.
Method Detail

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.