Esempio n. 1
0
 private void expandSupertypes(Multimap<String, String> mmap, String key, Class<?> type) {
   for (Class<?> supertype : ReflectionUtils.getSuperTypes(type)) {
     if (mmap.put(supertype.getName(), key)) {
       if (log != null) log.debug("expanded subtype {} -> {}", supertype.getName(), key);
       expandSupertypes(mmap, supertype.getName(), supertype);
     }
   }
 }
Esempio n. 2
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()));
 }