org.apache.commons.collections.functors
public class ChainedTransformer extends Object implements Transformer, Serializable
The input object is passed to the first transformer. The transformed result is passed to the second transformer and so on.
Since: Commons Collections 3.0
Version: $Revision: 348444 $ $Date: 2005-11-23 14:06:56 +0000 (Wed, 23 Nov 2005) $
Constructor Summary | |
---|---|
ChainedTransformer(Transformer[] transformers)
Constructor that performs no validation.
|
Method Summary | |
---|---|
static Transformer | getInstance(Transformer[] transformers)
Factory method that performs validation and copies the parameter array.
|
static Transformer | getInstance(Collection transformers)
Create a new Transformer that calls each transformer in turn, passing the
result into the next transformer. |
static Transformer | getInstance(Transformer transformer1, Transformer transformer2)
Factory method that performs validation.
|
Transformer[] | getTransformers()
Gets the transformers, do not modify the array. |
Object | transform(Object object)
Transforms the input to result via each decorated transformer
|
getInstance
if you want that.
Parameters: transformers the transformers to chain, not copied, no nulls
Parameters: transformers the transformers to chain, copied, no nulls
Returns: the chained
transformer
Throws: IllegalArgumentException if the transformers array is null IllegalArgumentException if any transformer in the array is null
Parameters: transformers a collection of transformers to chain
Returns: the chained
transformer
Throws: IllegalArgumentException if the transformers collection is null IllegalArgumentException if any transformer in the collection is null
Parameters: transformer1 the first transformer, not null transformer2 the second transformer, not null
Returns: the chained
transformer
Throws: IllegalArgumentException if either transformer is null
Returns: the transformers
Since: Commons Collections 3.1
Parameters: object the input object passed to the first transformer
Returns: the transformed result