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.
Version:
- Stephen Colebourne
- Commons Collections 3.0
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.
- the closure
- Commons Collections 3.1
getInstance
public static Transformer getInstance(Closure closure)
Factory method that performs validation.
closure
- the closure to call, not null
- the
closure
transformer
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
- the transformed result
Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.