org.apache.commons.collections.functors
Class InvokerTransformer
- Serializable, Transformer
public class InvokerTransformer
Transformer implementation that creates a new object instance by reflection.
Version:
- Stephen Colebourne
- Commons Collections 3.0
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
- an invoker transformer
- Commons Collections 3.1
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
- an invoker transformer
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-2005 Apache Software Foundation. All Rights Reserved.