public class ChainedTransformer extends java.lang.Object implements Transformer, java.io.Serializable
The input object is passed to the first transformer. The transformed result is passed to the second transformer and so on.
| Constructor and Description |
|---|
ChainedTransformer(Transformer[] transformers)
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
static Transformer |
getInstance(java.util.Collection transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer.
|
static Transformer |
getInstance(Transformer[] transformers)
Factory method that performs validation and copies the parameter array.
|
static Transformer |
getInstance(Transformer transformer1,
Transformer transformer2)
Factory method that performs validation.
|
Transformer[] |
getTransformers()
Gets the transformers, do not modify the array.
|
java.lang.Object |
transform(java.lang.Object object)
Transforms the input to result via each decorated transformer
|
public ChainedTransformer(Transformer[] transformers)
getInstance if you want that.transformers - the transformers to chain, not copied, no nullspublic static Transformer getInstance(Transformer[] transformers)
transformers - the transformers to chain, copied, no nullschained transformerjava.lang.IllegalArgumentException - if the transformers array is nulljava.lang.IllegalArgumentException - if any transformer in the array is nullpublic static Transformer getInstance(java.util.Collection transformers)
transformers - a collection of transformers to chainchained transformerjava.lang.IllegalArgumentException - if the transformers collection is nulljava.lang.IllegalArgumentException - if any transformer in the collection is nullpublic static Transformer getInstance(Transformer transformer1, Transformer transformer2)
transformer1 - the first transformer, not nulltransformer2 - the second transformer, not nullchained transformerjava.lang.IllegalArgumentException - if either transformer is nullpublic java.lang.Object transform(java.lang.Object object)
transform in interface Transformerobject - the input object passed to the first transformerpublic Transformer[] getTransformers()
Copyright © 2010 - 2023 Adobe. All Rights Reserved