org.apache.commons.collections.functors
Class ClosureTransformer
java.lang.Objectorg.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: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
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-2008 Apache Software Foundation. All Rights Reserved.