Home / Class/ OnWarDeploymentCondition Class — spring-boot Architecture

OnWarDeploymentCondition Class — spring-boot Architecture

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

Entity Profile

Source Code

core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWarDeploymentCondition.java lines 35–51

class OnWarDeploymentCondition extends SpringBootCondition {

	@Override
	public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
		boolean required = metadata.isAnnotated(ConditionalOnWarDeployment.class.getName());
		ResourceLoader resourceLoader = context.getResourceLoader();
		if (resourceLoader instanceof WebApplicationContext applicationContext) {
			ServletContext servletContext = applicationContext.getServletContext();
			if (servletContext != null) {
				return new ConditionOutcome(required, "Application is deployed as a WAR file.");
			}
		}
		return new ConditionOutcome(!required, ConditionMessage.forCondition(ConditionalOnWarDeployment.class)
			.because("the application is not deployed as a WAR file."));
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free