/// <summary> /// This is used to extract the class from the specified type. If /// there are no actual generic type arguments to the specified /// type then this will return null. Otherwise this will return /// the actual class, regardless of whether the class is an array. /// </summary> /// <param name="type"> /// this is the type to extract the class from /// </param> /// <returns> /// this returns the class type from the first parameter /// </returns> public Class GetClass(ParameterizedType type) { Type[] list = type.getActualTypeArguments(); if (list.length > 0) { return(GetClass(list[0])); } return(null); }
/// <summary> /// This is used to extract the class from the specified type. If /// there are no actual generic type arguments to the specified /// type then this will return null. Otherwise this will return /// the actual class, regardless of whether the class is an array. /// </summary> /// <param name="type"> /// this is the type to extract the class from /// </param> /// <returns> /// this returns the class type from the first parameter /// </returns> public Class[] GetClasses(ParameterizedType type) { Type[] list = type.getActualTypeArguments(); Class[] types = new Class[list.length]; for (int i = 0; i < list.length; i++) { types[i] = GetClass(list[i]); } return(types); }
/// <summary> /// This is used to extract the class from the specified type. If /// there are no actual generic type arguments to the specified /// type then this will return null. Otherwise this will return /// the actual class, regardless of whether the class is an array. /// </summary> /// <param name="type"> /// this is the type to extract the class from /// </param> /// <returns> /// this returns the class type from the first parameter /// </returns> public Class[] GetClasses(ParameterizedType type) { Type[] list = type.getActualTypeArguments(); Class[] types = new Class[list.length]; for(int i = 0; i < list.length; i++) { types[i] = GetClass(list[i]); } return types; }
/// <summary> /// This is used to extract the class from the specified type. If /// there are no actual generic type arguments to the specified /// type then this will return null. Otherwise this will return /// the actual class, regardless of whether the class is an array. /// </summary> /// <param name="type"> /// this is the type to extract the class from /// </param> /// <returns> /// this returns the class type from the first parameter /// </returns> public Class GetClass(ParameterizedType type) { Type[] list = type.getActualTypeArguments(); if(list.length > 0) { return GetClass(list[0]); } return null; }