Java Code Examples for org.apache.commons.collections.functors.InvokerTransformer#getInstance()

The following examples show how to use org.apache.commons.collections.functors.InvokerTransformer#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransformerUtils.java    From Penetration_Testing_POC with Apache License 2.0 2 votes vote down vote up
/**
 * Gets a Transformer that invokes a method on the input object.
 * The method must have no parameters. If the input object is null, 
 * null is returned.
 * <p>
 * For example, <code>TransformerUtils.invokerTransformer("getName");</code>
 * will call the <code>getName/code> method on the input object to 
 * determine the transformer result.
 * 
 * @see org.apache.commons.collections.functors.InvokerTransformer
 * 
 * @param methodName  the method name to call on the input object, may not be null
 * @return the transformer
 * @throws IllegalArgumentException if the methodName is null.
 */
public static Transformer invokerTransformer(String methodName){
    return InvokerTransformer.getInstance(methodName, null, null);
}
 
Example 2
Source File: TransformerUtils.java    From Penetration_Testing_POC with Apache License 2.0 2 votes vote down vote up
/**
 * Gets a Transformer that invokes a method on the input object.
 * The method parameters are specified. If the input object is null, 
 * null is returned.
 * 
 * @see org.apache.commons.collections.functors.InvokerTransformer
 * 
 * @param methodName  the name of the method
 * @param paramTypes  the parameter types
 * @param args  the arguments
 * @return the transformer
 * @throws IllegalArgumentException if the method name is null
 * @throws IllegalArgumentException if the paramTypes and args don't match
 */
public static Transformer invokerTransformer(String methodName, Class[] paramTypes, Object[] args){
    return InvokerTransformer.getInstance(methodName, paramTypes, args);
}