java.io.Serializable, Closure<E>public class TransformerClosure<E> extends java.lang.Object implements Closure<E>, java.io.Serializable
| Constructor | Description |
|---|---|
TransformerClosure(Transformer<? super E,?> transformer) |
Constructor that performs no validation.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
execute(E input) |
Executes the closure by calling the decorated transformer.
|
Transformer<? super E,?> |
getTransformer() |
Gets the transformer.
|
static <E> Closure<E> |
transformerClosure(Transformer<? super E,?> transformer) |
Factory method that performs validation.
|
public TransformerClosure(Transformer<? super E,?> transformer)
transformerClosure if you want that.transformer - the transformer to call, not nullpublic static <E> Closure<E> transformerClosure(Transformer<? super E,?> transformer)
A null transformer will return the NOPClosure.
E - the type that the closure acts ontransformer - the transformer to call, null means noptransformer closurepublic void execute(E input)
public Transformer<? super E,?> getTransformer()
Copyright © 2001-2019 - Apache Software Foundation