@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented @Conditional(value=org.springframework.boot.autoconfigure.condition.OnClassCondition.class) public @interface ConditionalOnClass
@Conditional
that only matches when the specified classes are on
the classpath.
A value()
can be safely specified on @Configuration
classes as the
annotation metadata is parsed by using ASM before the class is loaded. Extra care is
required when placed on @Bean
methods, consider isolating the condition in a
separate Configuration
class, in particular if the return type of the method
matches the target of the condition
.
public abstract Class<?>[] value
name()
attribute.public abstract String[] name
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.