code: private Collection<ComponentDescriptor<?>> getComponentsDescriptors(ClassLoader classLoader,
          List<ComponentDeclaration> componentDeclarations)
      {
          // For each component class name found, load its class and use introspection to find the necessary
          // annotations required to create a Component Descriptor.
          Map<RoleHint<?>, ComponentDescriptor<?>> descriptorMap = new HashMap<>();
          Map<RoleHint<?>, Integer> priorityMap = new HashMap<>();
  
          for (ComponentDeclaration componentDeclaration : componentDeclarations) {
              Class<?> componentClass;
              try {
                  componentClass = classLoader.loadClass(componentDeclaration.getImplementationClassName());
              } catch (Exception e) {
                  throw new RuntimeException(
                      String.format("Failed to load component class [%s] for annotation parsing",
                          componentDeclaration.getImplementationClassName()), e);
              }
  
              // Look for ComponentRole annotations and register one component per ComponentRole found
              for (Type componentRoleType : findComponentRoleTypes(componentClass)) {
                  for (ComponentDescriptor<?> componentDescriptor : this.factory.createComponentDescriptors(
                      componentClass, componentRoleType)) {
                      // If there's already a existing role/hint in the list of descriptors then decide which one
                      // to keep by looking at their priorities. Highest priority wins (i.e. lowest integer value).
                      RoleHint<?> roleHint =
                          new RoleHint(componentDescriptor.getRoleType(), componentDescriptor.getRoleHint());
  
                      addComponent(descriptorMap, priorityMap, roleHint, componentDescriptor, componentDeclaration,
                          true);
                  }
              }
          }
  
          return descriptorMap.values();
      }
docs: Find all component descriptors out of component declarations.
  
  @param classLoader the classloader used to load the component declaration implementation class.
  @param componentDeclarations the list of component declarations for which you want to build the component
  descriptor.
  @return a collection of component descriptors corresponding to the given component declarations.
  @since 11.1