public class ClosureTransformer extends Object implements Transformer, Serializable
Constructor and Description |
---|
ClosureTransformer(Closure closure)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
Closure |
getClosure()
Gets the closure.
|
static Transformer |
getInstance(Closure closure)
Factory method that performs validation.
|
Object |
transform(Object input)
Transforms the input to result by executing a closure.
|
public ClosureTransformer(Closure closure)
getInstance
if you want that.closure
- the closure to call, not nullpublic static Transformer getInstance(Closure closure)
closure
- the closure to call, not nullclosure
transformerIllegalArgumentException
- if the closure is nullpublic Object transform(Object input)
transform
in interface Transformer
input
- the input object to transformpublic Closure getClosure()
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.