|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections.functors.ChainedTransformer<I,O>
public class ChainedTransformer<I,O>
Transformer implementation that chains the specified transformers together.
The input object is passed to the first transformer. The transformed result is passed to the second transformer and so on.
| Constructor Summary | |
|---|---|
ChainedTransformer(Transformer[] transformers)
Constructor that performs no validation. |
|
| Method Summary | ||
|---|---|---|
static
|
getInstance(Collection<Transformer> transformers)
Create a new Transformer that calls each transformer in turn, passing the result into the next transformer. |
|
static
|
getInstance(Transformer[] transformers)
Factory method that performs validation and copies the parameter array. |
|
static
|
getInstance(Transformer<I,? extends M> transformer1,
Transformer<? super M,O> transformer2)
Factory method that performs validation. |
|
Transformer[] |
getTransformers()
Gets the transformers, do not modify the array. |
|
O |
transform(I object)
Transforms the input to result via each decorated transformer |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChainedTransformer(Transformer[] transformers)
getInstance if you want that.
transformers - the transformers to chain, not copied, no nulls| Method Detail |
|---|
public static <I,O> Transformer<I,O> getInstance(Transformer[] transformers)
transformers - the transformers to chain, copied, no nulls
chained transformer
IllegalArgumentException - if the transformers array is null
IllegalArgumentException - if any transformer in the array is nullpublic static <I,O> Transformer<I,O> getInstance(Collection<Transformer> transformers)
transformers - a collection of transformers to chain
chained transformer
IllegalArgumentException - if the transformers collection is null
IllegalArgumentException - if any transformer in the collection is null
public static <I,M,O> Transformer<I,O> getInstance(Transformer<I,? extends M> transformer1,
Transformer<? super M,O> transformer2)
transformer1 - the first transformer, not nulltransformer2 - the second transformer, not null
chained transformer
IllegalArgumentException - if either transformer is nullpublic O transform(I object)
transform in interface Transformer<I,O>object - the input object passed to the first transformer
public Transformer[] getTransformers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||