public class TransformerClosure<E> extends Object implements Closure<E>, Serializable
Constructor and Description |
---|
TransformerClosure(Transformer<? super E,?> 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<? 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 Transformer<? super E,?> getTransformer()
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.