Home / Function/ withProfiles() — spring-boot Function Reference

withProfiles() — spring-boot Function Reference

Architecture documentation for the withProfiles() function in ConfigDataEnvironment.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  b51c4ada_4659_cf4b_db08_796eaec2c765["withProfiles()"]
  29c97804_46ca_38e2_45f8_a0bee530b831["processAndApply()"]
  29c97804_46ca_38e2_45f8_a0bee530b831 -->|calls| b51c4ada_4659_cf4b_db08_796eaec2c765
  5f0c1c36_012f_880d_d499_3a02c8f8dab2["getBinder()"]
  b51c4ada_4659_cf4b_db08_796eaec2c765 -->|calls| 5f0c1c36_012f_880d_d499_3a02c8f8dab2
  92915ccd_e778_0255_307b_110eec0980aa["getIncludedProfiles()"]
  b51c4ada_4659_cf4b_db08_796eaec2c765 -->|calls| 92915ccd_e778_0255_307b_110eec0980aa
  style b51c4ada_4659_cf4b_db08_796eaec2c765 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironment.java lines 275–293

	private ConfigDataActivationContext withProfiles(ConfigDataEnvironmentContributors contributors,
			ConfigDataActivationContext activationContext) {
		this.logger.trace("Deducing profiles from current config data environment contributors");
		Binder binder = contributors.getBinder(activationContext,
				(contributor) -> !contributor.hasConfigDataOption(ConfigData.Option.IGNORE_PROFILES),
				BinderOption.FAIL_ON_BIND_TO_INACTIVE_SOURCE);
		try {
			Set<String> additionalProfiles = new LinkedHashSet<>(this.additionalProfiles);
			additionalProfiles.addAll(getIncludedProfiles(contributors, activationContext));
			Profiles profiles = new Profiles(this.environment, binder, additionalProfiles);
			return activationContext.withProfiles(profiles);
		}
		catch (BindException ex) {
			if (ex.getCause() instanceof InactiveConfigDataAccessException inactiveException) {
				throw inactiveException;
			}
			throw ex;
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does withProfiles() do?
withProfiles() is a function in the spring-boot codebase.
What does withProfiles() call?
withProfiles() calls 2 function(s): getBinder, getIncludedProfiles.
What calls withProfiles()?
withProfiles() is called by 1 function(s): processAndApply.

Analyze Your Own Codebase

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

Try Supermodel Free