1 17 package org.apache.servicemix.beanflow.support; 18 19 import java.lang.reflect.InvocationTargetException ; 20 import java.lang.reflect.Method ; 21 22 27 public class EnumHelper { 28 private static final Class [] NO_PARAMETER_TYPES = {}; 29 private static final Object [] NO_PARAMETER_VALUES = {}; 30 31 public static Object [] getEnumValues(Class enumType) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { 32 Method method = enumType.getMethod("values", NO_PARAMETER_TYPES); 33 return (Object []) method.invoke(null, NO_PARAMETER_VALUES); 34 } 35 } 36 | Popular Tags |