Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.collections.functors
Class InstantiateTransformer

    java.lang.Object
      org.apache.commons.collections.functors.InstantiateTransformer

All Implemented Interfaces:
  java.io.Serializable, Transformer

    public class InstantiateTransformer

extends java.lang.Object
implements Transformer, java.io.Serializable

Transformer implementation that creates a new object instance by reflection.

Since:
  Commons Collections 3.0
Version:
  $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
Author:
  Stephen Colebourne
See Also:
  Serialized Form

Field Summary
`static Transformer` | `NO_ARG_INSTANCE` Singleton instance that uses the no arg constructor

Constructor Summary
`InstantiateTransformer(java.lang.Class[] paramTypes, java.lang.Object[] args)` Constructor that performs no validation.

Method Summary
`static Transformer` | `getInstance(java.lang.Class[] paramTypes, java.lang.Object[] args)` Transformer method that performs validation.
`java.lang.Object` | `transform(java.lang.Object input)` Transforms the input Class object to a result by instantiation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_ARG_INSTANCE

    public static final Transformer NO_ARG_INSTANCE

  Singleton instance that uses the no arg constructor

Constructor Detail

### InstantiateTransformer

    public InstantiateTransformer(java.lang.Class[] paramTypes,
                                  java.lang.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 Detail

### getInstance

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

  Transformer method that performs validation.

  Parameters:
    `paramTypes` - the constructor parameter types
    `args` - the constructor arguments
  Returns:
    an instantiate transformer

### transform

    public java.lang.Object transform(java.lang.Object input)

  Transforms the input Class object to a result by instantiation.

  Specified by:
    `transform` in interface `Transformer`
  Parameters:
    `input` - the input object to transform
  Returns:
    the transformed result

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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