java.io.Serializable, Transformerpublic class ClosureTransformer extends java.lang.Object implements Transformer, java.io.Serializable
| Constructor | Description |
|---|---|
ClosureTransformer(Closure closure) |
Constructor that performs no validation.
|
| Modifier and Type | Method | Description |
|---|---|---|
Closure |
getClosure() |
Gets the closure.
|
static Transformer |
getInstance(Closure closure) |
Factory method that performs validation.
|
java.lang.Object |
transform(java.lang.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 transformerjava.lang.IllegalArgumentException - if the closure is nullpublic java.lang.Object transform(java.lang.Object input)
transform in interface Transformerinput - the input object to transformpublic Closure getClosure()
Copyright © 2001-2018 Apache Software Foundation. All Rights Reserved.