コード例 #1
0
  /** @param ci */
  private void collectWithSubClasses(
      IClassInventory classInventory, IClassInfo ci, Set<Class> collector) {
    if (ci.isEnum() || ci.isAnnotation() || ci.isSynthetic() || !ci.isPublic()) {
      LOG.debug(
          "Skipping bean candidate '{}' because it is no supported class type (enum, annotation, anonymous class) or is not public.",
          ci.name());
      return;
    }

    collect(ci, collector);

    if (!ci.isFinal()) {
      try {
        Set<IClassInfo> allKnownSubClasses =
            classInventory.getAllKnownSubClasses(ci.resolveClass());
        for (IClassInfo subClass : allKnownSubClasses) {
          collect(subClass, collector);
        }
      } catch (Exception e) {
        LOG.warn("Could not resolve known sub classes of [{}]", ci.name(), e);
      }
    }
  }