org.apache.commons.collections.functors
Class InvokerTransformer
java.lang.Object
org.apache.commons.collections.functors.InvokerTransformer
- Serializable, Transformer
public class InvokerTransformer
extends java.lang.Object
Transformer implementation that creates a new object instance by reflection.
$Revision: 1.7 $ $Date: 2004/05/26 21:44:05 $InvokerTransformer(String methodName, Class[] paramTypes, Object[] args) - Constructor that performs no validation.
|
static Transformer | getInstance(String methodName) - Gets an instance of this transformer calling a specific method with no arguments.
|
static Transformer | getInstance(String methodName, Class[] paramTypes, Object[] args) - Gets an instance of this transformer calling a specific method with specific values.
|
Object | transform(Object input) - Transforms the input to result by invoking a method on the input.
|
InvokerTransformer
public InvokerTransformer(String methodName,
Class[] paramTypes,
Object[] args)
Constructor that performs no validation.
Use getInstance
if you want that.
methodName
- the method to callparamTypes
- the constructor parameter types, not clonedargs
- the constructor arguments, not cloned
getInstance
public static Transformer getInstance(String methodName)
Gets an instance of this transformer calling a specific method with no arguments.
methodName
- the method name to call
getInstance
public static Transformer getInstance(String methodName,
Class[] paramTypes,
Object[] args)
Gets an instance of this transformer calling a specific method with specific values.
methodName
- the method name to callparamTypes
- the parameter types of the methodargs
- the arguments to pass to the method
transform
public Object transform(Object input)
Transforms the input to result by invoking a method on the input.
- transform in interface Transformer
input
- the input object to transform
- the transformed result, null if null input
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.