Here you can find the source of getSuperClasses(Class> cls)
Parameter | Description |
---|---|
cls | Class to get super classes. |
static List<Class<?>> getSuperClasses(Class<?> cls)
//package com.java2s; // Copyright (C) GridGain Systems Licensed under GPLv3, http://www.gnu.org/licenses/gpl.html import java.util.*; public class Main { /**/*from w w w. j a v a 2 s . co m*/ * @param cls Class to get super classes. * @return Super classes for given class. */ static List<Class<?>> getSuperClasses(Class<?> cls) { List<Class<?>> results = new ArrayList<Class<?>>(); Class<?> cur = cls; while (cur != null) { results.add(cur); cur = cur.getSuperclass(); } return results; } }