⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.functors

Class FactoryTransformer

java.lang.Object
|
+--org.apache.commons.collections.functors.FactoryTransformer

All Implemented Interfaces:
Transformer, Serializable


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

Transformer implementation that calls a Factory and returns the result.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

FactoryTransformer(Factory factory)

Constructor that performs no validation.

Method Summary

static Transformer

getInstance(Factory factory)

Factory method that performs validation.

Object

transform(Object input)

Call the 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

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:
- if the factory is null

transform

public Object transform(Object input)

Call the factory.

Parameters:
input