org.springframework.core.closure.support
Class Block

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.core.closure.support.AbstractClosure
          extended by org.springframework.core.closure.support.Block
All Implemented Interfaces:
Serializable, Closure
Direct Known Subclasses:
IfBlock

public abstract class Block
extends AbstractClosure

Convenient super class for closures that encapsulate a block of executable code. Subclasses should override void handle(Object) for executing a block of code without a result.

Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
Block()
           
 
Method Summary
 Object call(Object argument)
          Evaluate the function with the provided argument, returning the result.
protected abstract  void handle(Object argument)
          Method to override in block subclasses that return no result: this method is intended encapsulate the block's processing.
 
Methods inherited from class org.springframework.core.closure.support.AbstractClosure
forEach, forEach
 
Methods inherited from class org.springframework.core.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

Block

public Block()
Method Detail

call

public final Object call(Object argument)
Evaluate the function with the provided argument, returning the result.

Parameters:
argument - the argument
Returns:
allways null, only code is executed.

handle

protected abstract void handle(Object argument)
Method to override in block subclasses that return no result: this method is intended encapsulate the block's processing.

Parameters:
argument - the argument to process


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.