org.apache.commons.collections.functors
Class ChainedTransformer
java.lang.Object
org.apache.commons.collections.functors.ChainedTransformer
- Serializable, Transformer
public class ChainedTransformer
extends java.lang.Object
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.
$Revision: 1.7 $ $Date: 2004/05/16 11:36:31 $
ChainedTransformer
public ChainedTransformer(Transformer[] transformers)
Constructor that performs no validation.
Use getInstance
if you want that.
transformers
- the transformers to chain, not copied, no nulls
getInstance
public static Transformer getInstance(Collection transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer. The ordering is that of the iterator()
method on the collection.
transformers
- a collection of transformers to chain
getInstance
public static Transformer getInstance(Transformer transformer1,
Transformer transformer2)
Factory method that performs validation.
transformer1
- the first transformer, not nulltransformer2
- the second transformer, not null
getInstance
public static Transformer getInstance(Transformer[] transformers)
Factory method that performs validation and copies the parameter array.
transformers
- the transformers to chain, copied, no nulls
getTransformers
public Transformer[] getTransformers()
Gets the transformers, do not modify the array.
transform
public Object transform(Object object)
Transforms the input to result via each decorated transformer
- transform in interface Transformer
object
- the input object passed to the first transformer
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.