org.apache.commons.collections.functors
Class ClosureTransformer
java.lang.Object
org.apache.commons.collections.functors.ClosureTransformer
- Serializable, Transformer
public class ClosureTransformer
extends java.lang.Object
Transformer implementation that calls a Closure using the input object
and then returns the input.
$Revision: 1.5 $ $Date: 2004/05/16 11:36:31 $
ClosureTransformer
public ClosureTransformer(Closure closure)
Constructor that performs no validation.
Use getInstance
if you want that.
closure
- the closure to call, not null
getClosure
public Closure getClosure()
Gets the closure.
getInstance
public static Transformer getInstance(Closure closure)
Factory method that performs validation.
closure
- the closure to call, not null
transform
public Object transform(Object input)
Transforms the input to result by executing a closure.
- transform in interface Transformer
input
- the input object to transform
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.