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

Class InstantiateTransformer

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

All Implemented Interfaces:
Transformer, Serializable


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

Transformer implementation that creates a new object instance by reflection.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Field Summary

static Transformer

NO_ARG_INSTANCE

Singleton instance that uses the no arg constructor

Constructor Summary

InstantiateTransformer(Class[] paramTypes, Object[] args)

Constructor that performs no validation.

Method Summary

static Transformer

getInstance(Class[] paramTypes, Object[] args)

Transformer method that performs validation.

Object

transform(Object input)

Return the result of instantiating the input Class object.

Field Details

NO_ARG_INSTANCE

public static final Transformer NO_ARG_INSTANCE

Singleton instance that uses the no arg constructor

Constructor Details

InstantiateTransformer

public InstantiateTransformer(Class[] paramTypes, Object[] args)

Constructor that performs no validation. Use getInstance if you want that.

Parameters:
paramTypes - the constructor parameter types, not cloned
args - the constructor arguments, not cloned

Method Details

getInstance

public static Transformer getInstance(Class[] paramTypes, Object[] args)

Transformer method that performs validation.

Parameters:
paramTypes - the constructor parameter types
args - the constructor arguments

transform

public Object transform(Object input)

Return the result of instantiating the input Class object.

Parameters:
input