org.apache.commons.collections.functors

Class FactoryTransformer

public class FactoryTransformer extends Object implements Transformer, Serializable

Transformer implementation that calls a Factory and returns the result.

Since: Commons Collections 3.0

Version: $Revision: 348444 $ $Date: 2005-11-23 14:06:56 +0000 (Wed, 23 Nov 2005) $

Author: Stephen Colebourne

Constructor Summary
FactoryTransformer(Factory factory)
Constructor that performs no validation.
Method Summary
FactorygetFactory()
Gets the factory.
static TransformergetInstance(Factory factory)
Factory method that performs validation.
Objecttransform(Object input)
Transforms the input by ignoring the input and returning the result of calling the decorated factory.

Constructor Detail

FactoryTransformer

public FactoryTransformer(Factory factory)
Constructor that performs no validation. Use getInstance if you want that.

Parameters: factory the factory to call, not null

Method Detail

getFactory

public Factory getFactory()
Gets the factory.

Returns: the factory

Since: Commons Collections 3.1

getInstance

public static Transformer getInstance(Factory factory)
Factory method that performs validation.

Parameters: factory the factory to call, not null

Returns: the factory transformer

Throws: IllegalArgumentException if the factory is null

transform

public Object transform(Object input)
Transforms the input by ignoring the input and returning the result of calling the decorated factory.

Parameters: input the input object to transform

Returns: the transformed result

Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.