
com.c4_soft.springaddons.rest.IsServletWithWebClientCondition Maven / Gradle / Ivy
package com.c4_soft.springaddons.rest;
import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.web.reactive.function.client.WebClient;
/**
* A conditon to apply @Configuration only if an application is a servlet and if
* {@link WebClient} is on the class-path
*
* @author Jérôme Wacongne <ch4mp@c4-soft.com>
*/
public class IsServletWithWebClientCondition extends AllNestedConditions {
IsServletWithWebClientCondition() {
super(ConfigurationPhase.PARSE_CONFIGURATION);
}
@ConditionalOnWebApplication(type = Type.SERVLET)
static class IsServlet {
}
@ConditionalOnClass(WebClient.class)
static class IsWebClientOnClasspath {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy