All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.astamuse.asta4d.util.ClassUtil Maven / Gradle / Ivy

Go to download

core functionalities of asta4d framework, including template and snippt implemention

There is a newer version: 1.2-M2
Show newest version
package com.astamuse.asta4d.util;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class ClassUtil {
    @SuppressWarnings("rawtypes")
    public static final List retrieveAllFieldsIncludeAllSuperClasses(Class cls) {
        Class c = cls;
        List resultList = new LinkedList();
        while (!c.getName().equals("java.lang.Object")) {
            resultList.addAll(Arrays.asList(c.getDeclaredFields()));
            c = c.getSuperclass();
        }
        return resultList;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy