Java Reflection Super Class getSuperClasses(Class c)

Here you can find the source of getSuperClasses(Class c)

Description

get Super Classes

License

Open Source License

Declaration

public final static List<Class<?>> getSuperClasses(Class<?> c) 

Method Source Code

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

import java.util.ArrayList;
import java.util.List;

public class Main {
    public final static List<Class<?>> getSuperClasses(Class<?> c) {
        List<Class<?>> classes = new ArrayList<Class<?>>();
        classes.add(c);/*  w w w.ja  v a2s . c o m*/
        while (c != null) {
            c = c.getSuperclass();
            if ((c == null) || c.getClass().equals(Object.class))
                break;
            classes.add(c);
        }
        return classes;
    }
}

Related

  1. getParents(final Class Class)
  2. getSuper(Class clazz, Set result)
  3. getSuperClasses(Class clazz, Set result)
  4. getSuperClasses(Class clz, boolean reverseOrder)
  5. getSuperclasses(Class from)
  6. getSuperclasses(Class clazz)
  7. getSuperClasses(Class clazz)
  8. getSuperclasses(Class clazz)
  9. getSuperClasses(Class cls)