| 11 | |
| 12 | public class Reflection { |
| 13 | public static |
| 14 | Set<String> analyze(Class<?> enumClass) { |
| 15 | System.out.println( |
| 16 | "_____ Analyzing " + enumClass + " _____"); |
| 17 | System.out.println("Interfaces:"); |
| 18 | for(Type t : enumClass.getGenericInterfaces()) |
| 19 | System.out.println(t); |
| 20 | System.out.println( |
| 21 | "Base: " + enumClass.getSuperclass()); |
| 22 | System.out.println("Methods: "); |
| 23 | Set<String> methods = new TreeSet<>(); |
| 24 | for(Method m : enumClass.getMethods()) |
| 25 | methods.add(m.getName()); |
| 26 | System.out.println(methods); |
| 27 | return methods; |
| 28 | } |
| 29 | public static void main(String[] args) { |
| 30 | Set<String> exploreMethods = |
| 31 | analyze(Explore.class); |