예제 #1
0
 /**
  * gets all sub types in hierarchy of a given type
  *
  * <p>depends on SubTypesScanner configured
  */
 public <T> Set<Class<? extends T>> getSubTypesOf(final Class<T> type) {
   return Sets.newHashSet(
       ReflectionUtils.<T>forNames(
           store.getAll(index(SubTypesScanner.class), Arrays.asList(type.getName())), loaders()));
 }
예제 #2
0
 /**
  * gets all sub types in hierarchy of a given type
  *
  * <p>depends on SubTypesScanner configured, otherwise an empty set is returned
  */
 public <T> Set<Class<? extends T>> getSubTypesOf(final Class<T> type) {
   Set<String> subTypes = store.getSubTypesOf(type.getName());
   return ImmutableSet.copyOf(ReflectionUtils.<T>forNames(subTypes));
 }