org.apache.commons.collections.functors

Class FactoryTransformer

Implemented Interfaces:
Serializable, Transformer

public class FactoryTransformer
extends java.lang.Object
implements Transformer, Serializable

Transformer implementation that calls a Factory and returns the result.

Version:
$Revision: 1.6 $ $Date: 2004/05/16 11:36:31 $

Author:
Stephen Colebourne

Since:
Commons Collections 3.0

Constructor Summary

FactoryTransformer(Factory factory)
Constructor that performs no validation.

Method Summary

Factory
getFactory()
Gets the factory.
static Transformer
getInstance(Factory factory)
Factory method that performs validation.
Object
transform(Object input)
Transforms the input by ignoring the input and returning the result of calling the decorated factory.

Constructor Details

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 Details

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


transform

public Object transform(Object input)
Transforms the input by ignoring the input and returning the result of calling the decorated factory.
Specified by:
transform in interface Transformer

Parameters:
input - the input object to transform

Returns:
the transformed result


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