Java Reflection Generic Type getGenericSuperType(Type t)

Here you can find the source of getGenericSuperType(Type t)

Description

get Generic Super Type

License

Open Source License

Declaration

private static Type getGenericSuperType(Type t) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class Main {
    private static Type getGenericSuperType(Type t) {
        if (t instanceof Class) {
            return ((Class) t).getGenericSuperclass();
        } else if (t instanceof ParameterizedType) {
            return getGenericSuperType(((ParameterizedType) t).getRawType());
        }//from   w  w w  .  j a v  a  2  s.  c  o  m
        return null;
    }
}

Related

  1. getGenericElementType(Type type)
  2. getGenericFirst(Object obj)
  3. getGenerics(Type genericType)
  4. getGenerics(Type t)
  5. getGenericString(AccessibleObject ao)
  6. getGenericType(@Nullable Type genericType)
  7. getGenericType(Member member, int index)
  8. getGenericType(Method setter)
  9. getGenericType(Object target)