public class TransformerClosure<E> extends Objectimplements Closure <E>, Serializable
| Constructor and Description |
|---|
TransformerClosure(Transformer
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(E input)
Executes the closure by calling the decorated transformer.
|
Transformer |
getTransformer()
Gets the transformer.
|
static <E> Closure |
transformerClosure(Transformer
Factory method that performs validation.
|
public TransformerClosure(Transformer<? super E ,?> transformer)
transformerClosure if you want that.
transformer - the transformer to call, not null
public static <E> Closure<E> transformerClosure(Transformer <? super E ,?> transformer)
A null transformer will return the NOPClosure.
E - the type that the closure acts on
transformer - the transformer to call, null means nop
transformer closure
public void execute(E input)
public Transformer<? super E ,?> getTransformer()