@Nullable
    @SuppressWarnings({ "unchecked", "rawtypes" })
    private static <T> Entry<Constructor<T>, List<AnnotatedValueResolver>> findConstructor(
            BeanFactoryId beanFactoryId, List<RequestObjectResolver> objectResolvers,
            DependencyInjector dependencyInjector) {

        Entry<Constructor<T>, List<AnnotatedValueResolver>> candidate = null;

        final Set<Constructor> constructors = getConstructors(beanFactoryId.type);
        for (final Constructor<T> constructor : constructors) {
            // A default constructor can be a candidate only if there has been no candidate yet.
            if (constructor.getParameterCount() == 0 && candidate == null) {
                candidate = new SimpleImmutableEntry<>(constructor, ImmutableList.of());
                continue;
            }

            try {
                final List<RequestConverter> converters =
                        AnnotationUtil.findDeclared(constructor, RequestConverter.class);
                final List<AnnotatedValueResolver> resolvers =
                        AnnotatedValueResolver.ofBeanConstructorOrMethod(
                                constructor, beanFactoryId.pathParams,
                                addToFirstIfExists(objectResolvers, converters, dependencyInjector),
                                dependencyInjector);
                if (!resolvers.isEmpty()) {
                    // Can overwrite only if the current candidate is a default constructor.
                    if (candidate == null || candidate.getValue().isEmpty()) {
                        candidate = new SimpleImmutableEntry<>(constructor, resolvers);
                    } else {
                        throw new IllegalArgumentException(
                                "too many annotated constructors in " + beanFactoryId.type.getSimpleName() +
                                " (expected: 0 or 1)");
                    }
                }
            } catch (NoAnnotatedParameterException ignored) {
                // There's no annotated parameters in the constructor.
            }
        }
        return candidate;
    }
Returns a factory of the specified {@link BeanFactoryId}.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedBeanFactoryRegistry.java