public static List < Class < ? > > getAllsuperClasses ( Class < ? > aClass ) { List < Class < ? > > result = new ArrayList < Class < ? > > ( ) ; result . add ( aClass ) ; Class < ? > superclass = aClass . getSuperclass ( ) ; while ( ! isNull ( superclass ) && superclass != Object . class ) { result . add ( superclass ) ; superclass = superclass . getSuperclass ( ) ; } return result ; }
Returns a list with the class passed in input plus his superclasses .