@Test public void findAssociateClass4() throws InstantiationException, IllegalAccessException, ClassNotFoundException { assertNotNull(ReflectionUtils.findAssociateClass(PacmanFix.class, "com.tmobile")); }
public static Class<?> findAssociateClass(String ruleKey) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Reflections reflections = new Reflections("com.tmobile"); Set<Class<?>> allRules = reflections.getTypesAnnotatedWith(PacmanRule.class); for (Class<?> ruleClass : allRules) { PacmanRule rule = ruleClass.getAnnotation(PacmanRule.class); if (rule.key().equals(ruleKey)) { return ruleClass; } } throw new ClassNotFoundException("cannot find class associated to rule"); }
ReflectionUtils { public static Class<?> findAssociateClass(String ruleKey) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Reflections reflections = new Reflections("com.tmobile"); Set<Class<?>> allRules = reflections.getTypesAnnotatedWith(PacmanRule.class); for (Class<?> ruleClass : allRules) { PacmanRule rule = ruleClass.getAnnotation(PacmanRule.class); if (rule.key().equals(ruleKey)) { return ruleClass; } } throw new ClassNotFoundException("cannot find class associated to rule"); } }
ReflectionUtils { public static Class<?> findAssociateClass(String ruleKey) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Reflections reflections = new Reflections("com.tmobile"); Set<Class<?>> allRules = reflections.getTypesAnnotatedWith(PacmanRule.class); for (Class<?> ruleClass : allRules) { PacmanRule rule = ruleClass.getAnnotation(PacmanRule.class); if (rule.key().equals(ruleKey)) { return ruleClass; } } throw new ClassNotFoundException("cannot find class associated to rule"); }  }
ReflectionUtils { public static Class<?> findAssociateClass(String ruleKey) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Reflections reflections = new Reflections("com.tmobile"); Set<Class<?>> allRules = reflections.getTypesAnnotatedWith(PacmanRule.class); for (Class<?> ruleClass : allRules) { PacmanRule rule = ruleClass.getAnnotation(PacmanRule.class); if (rule.key().equals(ruleKey)) { return ruleClass; } } throw new ClassNotFoundException("cannot find class associated to rule"); }  static Class<?> findAssociateClass(String ruleKey); static Class<?> findFixClass(String ruleKey); static Class<?> findAssociateClass(Class annotationClass, String hintPackage); static Method findAssociatedMethod(Object ruleClass, String methodName); static Method findEntryMethod(Object ruleClass, Class entryAnnotation); static Set<ReactorShell> findEventHandlers(String eventName); }
ReflectionUtils { public static Class<?> findAssociateClass(String ruleKey) throws InstantiationException, IllegalAccessException, ClassNotFoundException { Reflections reflections = new Reflections("com.tmobile"); Set<Class<?>> allRules = reflections.getTypesAnnotatedWith(PacmanRule.class); for (Class<?> ruleClass : allRules) { PacmanRule rule = ruleClass.getAnnotation(PacmanRule.class); if (rule.key().equals(ruleKey)) { return ruleClass; } } throw new ClassNotFoundException("cannot find class associated to rule"); }  static Class<?> findAssociateClass(String ruleKey); static Class<?> findFixClass(String ruleKey); static Class<?> findAssociateClass(Class annotationClass, String hintPackage); static Method findAssociatedMethod(Object ruleClass, String methodName); static Method findEntryMethod(Object ruleClass, Class entryAnnotation); static Set<ReactorShell> findEventHandlers(String eventName);  }