Home / Class/ ReflectionEnvironmentPostProcessorsFactory Class — spring-boot Architecture

ReflectionEnvironmentPostProcessorsFactory Class — spring-boot Architecture

Architecture documentation for the ReflectionEnvironmentPostProcessorsFactory class in ReflectionEnvironmentPostProcessorsFactory.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java lines 40–81

class ReflectionEnvironmentPostProcessorsFactory implements EnvironmentPostProcessorsFactory {

	private final @Nullable List<Class<?>> classes;

	private @Nullable ClassLoader classLoader;

	private @Nullable final List<String> classNames;

	ReflectionEnvironmentPostProcessorsFactory(Class<?>... classes) {
		this.classes = new ArrayList<>(Arrays.asList(classes));
		this.classNames = null;
	}

	ReflectionEnvironmentPostProcessorsFactory(@Nullable ClassLoader classLoader, String... classNames) {
		this(classLoader, Arrays.asList(classNames));
	}

	ReflectionEnvironmentPostProcessorsFactory(@Nullable ClassLoader classLoader, List<String> classNames) {
		this.classes = null;
		this.classLoader = classLoader;
		this.classNames = classNames;
	}

	@Override
	public List<EnvironmentPostProcessor> getEnvironmentPostProcessors(DeferredLogFactory logFactory,
			ConfigurableBootstrapContext bootstrapContext) {
		Instantiator<EnvironmentPostProcessor> instantiator = new Instantiator<>(EnvironmentPostProcessor.class,
				(parameters) -> {
					parameters.add(DeferredLogFactory.class, logFactory);
					parameters.add(Log.class, logFactory::getLog);
					parameters.add(ConfigurableBootstrapContext.class, bootstrapContext);
					parameters.add(BootstrapContext.class, bootstrapContext);
					parameters.add(BootstrapRegistry.class, bootstrapContext);
				});
		if (this.classes != null) {
			return instantiator.instantiateTypes(this.classes);
		}
		Assert.state(this.classNames != null, "'classNames' must not be null");
		return instantiator.instantiate(this.classLoader, this.classNames);
	}

}

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free