package com.github.aureliano.achmed.helper;

import java.lang.reflect.Method;

import com.github.aureliano.achmed.exception.AchmedException;

public final class ReflectionHelper {

	private ReflectionHelper() {
		throw new InstantiationError(this.getClass().getName() + " cannot be instantiated.");
	}
    
    public static Object callMethod(Object object, String methodName, Class<?>[] parametersType, Object[] methodParameters) {
    	Class<?> clazz = object.getClass();
    	try {
    		Method method = clazz.getMethod(methodName, parametersType);
    		return method.invoke(object, methodParameters);
    	} catch (Exception ex) {
    		throw new AchmedException(ex);
    	}
    }
    
    public static String getSimpleAccessMethodName(Method method) {
    	String name = method.getName().replaceFirst("^(get|is|set|with)", "");
    	return Character.toLowerCase(name.charAt(0)) + name.substring(1);
    }
}
package com.github.aureliano.achmed.helper;

import java.lang.reflect.Method;

public final class ReflectionHelper {

	private ReflectionHelper() {
		throw new InstantiationError(this.getClass().getName() + " cannot be instantiated.");
	}
    
    public static String getSimpleAccessMethodName(Method method) {
    	String name = method.getName().replaceFirst("^(get|is|set|with)", "");
    	return Character.toLowerCase(name.charAt(0)) + name.substring(1);
    }
}
--- 
+++ 
@@ -1,6 +1,8 @@
 package com.github.aureliano.achmed.helper;
 
 import java.lang.reflect.Method;
+
+import com.github.aureliano.achmed.exception.AchmedException;
 
 public final class ReflectionHelper {
 
@@ -8,6 +10,16 @@
 		throw new InstantiationError(this.getClass().getName() + " cannot be instantiated.");
 	}
     
+    public static Object callMethod(Object object, String methodName, Class<?>[] parametersType, Object[] methodParameters) {
+    	Class<?> clazz = object.getClass();
+    	try {
+    		Method method = clazz.getMethod(methodName, parametersType);
+    		return method.invoke(object, methodParameters);
+    	} catch (Exception ex) {
+    		throw new AchmedException(ex);
+    	}
+    }
+    
     public static String getSimpleAccessMethodName(Method method) {
     	String name = method.getName().replaceFirst("^(get|is|set|with)", "");
     	return Character.toLowerCase(name.charAt(0)) + name.substring(1);
Add method to call method through reflection.
