Here you can find the source of getAllSuperClasses(Class> clz)
Parameter | Description |
---|---|
clz | a parameter |
public static Class<?>[] getAllSuperClasses(Class<?> clz)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { /**/*from w ww . j av a 2 s . c o m*/ * Get all super classes * * @param clz * @return */ public static Class<?>[] getAllSuperClasses(Class<?> clz) { List<Class<?>> list = new ArrayList<>(); while ((clz = clz.getSuperclass()) != null) { list.add(clz); } return list.toArray(new Class<?>[list.size()]); } }