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);
    }
}
@@ -296,24 +296,209 @@
 %22);%0A%09%7D%0A    %0A
+    public static Object newInstance(Class%3C?%3E clazz) %7B%0A    %09try %7B%0A    %09%09return clazz.newInstance();%0A    %09%7D catch (Exception ex) %7B%0A    %09%09throw new AchmedException(ex);%0A    %09%7D%0A    %7D%0A    %0A
     public s

Add method to instantiate object by reflection.