Here you can find the source of getConstructorAccessor(Class> enumClass, Class>[] additionalParameterTypes)
private static Object getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes) throws Exception
//package com.java2s; //License from project: Open Source License import java.lang.reflect.*; public class Main { private static Object reflectionFactory = null; private static Method newConstructorAccessor = null; private static Object getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes) throws Exception { Class<?>[] parameterTypes = new Class[additionalParameterTypes.length + 2]; parameterTypes[0] = String.class; parameterTypes[1] = int.class; System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length); return newConstructorAccessor.invoke(reflectionFactory, enumClass.getDeclaredConstructor(parameterTypes)); }//from w w w .ja va2s.c om }