private Stream<Descriptor<T>> getDescriptors() {
        DescriptorExtensionList<T, Descriptor<T>> descriptorList = Jenkins.get().getDescriptorList(target);
        if (!descriptorList.isEmpty()) { // fast fetch for root objects
            return Stream.ofAll(descriptorList);
        }

        LOGGER.log(
                Level.FINEST,
                "getDescriptors(): Cannot find descriptors for {0}."
                        + "Will try parent classes to find proper extension points",
                target);
        DescriptorExtensionList parentDescriptorClassList = descriptorList;
        Class<?> effectiveTarget = target.getSuperclass();
        while (parentDescriptorClassList.isEmpty() && effectiveTarget != null && effectiveTarget != Object.class) {
            final Class<Describable> match;
            LOGGER.log(Level.FINEST, "getDescriptors() for {0}: Trying parent class {1}", new Object[] {
                target, effectiveTarget
            });
            try {
                match = (Class<Describable>) effectiveTarget;
            } catch (Exception ex) {
                if (LOGGER.isLoggable(Level.FINEST)) {
                    LOGGER.log(
                            Level.FINEST,
                            String.format(
                                    "getDescriptors() for %s: Class %s is not describable, interrupting search",
                                    target, effectiveTarget),
                            ex);
                }
                break;
            }
            parentDescriptorClassList = Jenkins.get().getDescriptorList(match);
            effectiveTarget = effectiveTarget.getSuperclass();
        }

        if (parentDescriptorClassList.isEmpty()) {
            return Stream.empty();
        }

        List<Descriptor<T>> descriptorsWithProperType = new ArrayList<>();
        Iterator<Descriptor> iterator = parentDescriptorClassList.iterator();
        while (iterator.hasNext()) {
            Descriptor<T> d = iterator.next();
            try {
                descriptorsWithProperType.add(d);
                LOGGER.log(
                        Level.FINEST,
                        "getDescriptors() for {0}: Accepting {1} as a suitable descriptor",
                        new Object[] {target, d});
            } catch (ClassCastException ex) {
                // ignored
                if (LOGGER.isLoggable(Level.FINEST)) {
                    LOGGER.log(
                            Level.FINEST,
                            String.format(
                                    "getDescriptors() for %s: Ignoring %s, because it is not a proper describable type",
                                    target, d),
                            ex);
                }
            }
        }
        return Stream.ofAll(descriptorsWithProperType);
    }
Matches suitable descriptors for the target.
The fetch is trivial when the target implements a root {@link Describable} object.
If not, we iterate to parent classes until we find a class which can provide the descriptor list in {@link Jenkins#getDescriptorList(Class)}.
Then we go through all the descriptors and find ones compliant with the target.
@return Stream of descriptors which match the target
plugin/src/main/java/io/jenkins/plugins/casc/impl/configurators/HeteroDescribableConfigurator.java