MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / analyze

Method analyze

enums/Reflection.java:13–28  ·  view source on GitHub ↗
(Class<?> enumClass)

Source from the content-addressed store, hash-verified

11
12public 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);

Callers 1

mainMethod · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected