src/main/java/com/rockagen/commons/util/ReflexUtil.java
public static Type getSuperClassGenricType(final Class<?> clazz, int index) {
		Type[] types = getSuperClassGenricTypes(clazz);
		if (index < 0) {
			log.warn(
					"{}'s index must be greater than 0,return the 0",
					clazz == null ? Object.class.getSimpleName() : clazz
							.getSimpleName());
			return types[0];
		} else if (index > types.length) {
			log.warn(
					"{}'s index in {} not found,return the last",
					clazz == null ? Object.class.getSimpleName() : clazz
							.getSimpleName(), index);
			return types[types.length - 1];
		} else {
			return types[index];
		}
	}
public static Type getSuperClassGenricType(final Class<?> clazz, int index) {
		Type[] types = getSuperClassGenricTypes(clazz);
		if (index < 0) {
			log.warn(
					"{}'s index must be greater than 0,return the 0",
					clazz == null ? Object.class.getSimpleName() : clazz
							.getSimpleName());
			return types[0];
		} else if (index > types.length) {
			log.warn(
					"{}'s index in {} not found,return the last",
					clazz == null ? Object.class.getSimpleName() : clazz
							.getSimpleName(), index);
			return types[types.length - 1];
		} else {
			return types[index];
		}
	}
public static Type getSuperClassGenricType ( final Class < ? > clazz , int index ) { Type [ ] types = getSuperClassGenricTypes ( clazz ) ; if ( index < 0 ) { log . warn ( "{}'s index must be greater than 0,return the 0" , clazz == null ? Object . class . getSimpleName ( ) : clazz . getSimpleName ( ) ) ; return types [ 0 ] ; } else if ( index > types . length ) { log . warn ( "{}'s index in {} not found,return the last" , clazz == null ? Object . class . getSimpleName ( ) : clazz . getSimpleName ( ) , index ) ; return types [ types . length - 1 ] ; } else { return types [ index ] ; } }
obtained the parent class generic parameter type
<p>
for example:
</p>
<code>
ClassB&lt;T&gt; extends ClassA&lt;T&gt;
</code>

@param clazz {@link java.lang.Class}
@param index
start 0
@return Type
obtained the parent class generic parameter type <p > for example : < / p > <code > ClassB&lt ; T&gt ; extends ClassA&lt ; T&gt ; < / code >