package pr2.reflection.analyzer;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Analyzer {

    public static void main(String[] args) {

        if (args.length != 1) {
            System.err.println("Bitte einen Klassennamen angeben.");
            System.exit(1);
        }

        try {
            Class<?> clazz = Class.forName(args[0]);
            Method[] methods = clazz.getMethods();
            Field[] fields = clazz.getFields();

            for (Field field : fields) {
                System.out.println(field);
            }

            for (Method method : methods) {
                System.out.println(method);
            }
        }
        catch (ClassNotFoundException e) {
            System.err.println("Klasse nicht gefunden.");
            System.exit(1);
        }
    }
}
