Skip to content

io microsphere spring beans factory ConstructionInjectionPointDependencyResolver

github-actions[bot] edited this page Jun 18, 2026 · 18 revisions

ConstructionInjectionPointDependencyResolver

Type: Class | Module: microsphere-spring-context | Package: io.microsphere.spring.beans.factory | Since: 1.0.0

Source: microsphere-spring-context/src/main/java/io/microsphere/spring/beans/factory/ConstructionInjectionPointDependencyResolver.java

Overview

InjectionPointDependencyResolver for Constructor

Declaration

public class ConstructionInjectionPointDependencyResolver extends AbstractInjectionPointDependencyResolver

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.27-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

resolve

ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  Field field = ReflectionUtils.findField(Config.class, "myField");
  Set<String> dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(field, beanFactory, dependentBeanNames);
  // dependentBeanNames is empty — fields are ignored

resolve

ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  Method method = MethodUtils.findMethod(Config.class, "setMyService", MyService.class);
  Set<String> dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(method, beanFactory, dependentBeanNames);
  // dependentBeanNames is empty — methods are ignored

resolve

ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  // Given: @Autowired public Config(Map<String, MyDependency> deps) { }
  Constructor<?> constructor = ConstructorUtils.findConstructor(Config.class, Map.class);
  Parameter parameter = constructor.getParameters()[0];
  Set<String> dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(parameter, beanFactory, dependentBeanNames);
  // dependentBeanNames contains bean names matching the parameter type

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-spring-context</artifactId>
    <version>${microsphere-spring.version}</version>
</dependency>

Tip: Use the BOM (microsphere-spring-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.spring.beans.factory.ConstructionInjectionPointDependencyResolver;

API Reference

Public Methods

Method Description
resolve No-op implementation. Field injection points are not resolved by
resolve No-op implementation. Method injection points are not resolved by
resolve Resolve the dependent bean names from the given Parameter only if the parameter

Method Details

resolve

public void resolve(Field field, ConfigurableListableBeanFactory beanFactory, Set<String> dependentBeanNames)

No-op implementation. Field injection points are not resolved by this resolver since it only handles Constructor parameters.

Example Usage

`ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  Field field = ReflectionUtils.findField(Config.class, "myField");
  Set dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(field, beanFactory, dependentBeanNames);
  // dependentBeanNames is empty — fields are ignored
`

resolve

public void resolve(Method method, ConfigurableListableBeanFactory beanFactory, Set<String> dependentBeanNames)

No-op implementation. Method injection points are not resolved by this resolver since it only handles Constructor parameters.

Example Usage

`ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  Method method = MethodUtils.findMethod(Config.class, "setMyService", MyService.class);
  Set dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(method, beanFactory, dependentBeanNames);
  // dependentBeanNames is empty — methods are ignored
`

resolve

public void resolve(Parameter parameter, ConfigurableListableBeanFactory beanFactory, Set<String> dependentBeanNames)

Resolve the dependent bean names from the given Parameter only if the parameter belongs to a Constructor. Parameters from methods are silently skipped.

Example Usage

`ConstructionInjectionPointDependencyResolver resolver = new ConstructionInjectionPointDependencyResolver();
  resolver.setBeanFactory(beanFactory);
  // Given: @Autowired public Config(Map deps) { `
  Constructor constructor = ConstructorUtils.findConstructor(Config.class, Map.class);
  Parameter parameter = constructor.getParameters()[0];
  Set dependentBeanNames = new LinkedHashSet<>();
  resolver.resolve(parameter, beanFactory, dependentBeanNames);
  // dependentBeanNames contains bean names matching the parameter type
}

This documentation was auto-generated from the source code of microsphere-spring.

Home

spring-context

spring-guice

spring-jdbc

spring-test

spring-web

spring-webflux

spring-webmvc

Clone this wiki locally