@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented public @interface ConditionalOnSingleCandidate
Conditional
that only matches when the specified bean class is already
contained in the BeanFactory
and a single candidate can be determined.
The condition will also match if multiple matching bean instances are already contained
in the BeanFactory
but a primary candidate has been defined; essentially, the
condition match if auto-wiring a bean with the defined type will succeed.
Modifier and Type | Optional Element and Description |
---|---|
SearchStrategy |
search
Strategy to decide if the application context hierarchy (parent contexts) should be
considered.
|
String |
type
The class type name of bean that should be checked.
|
Class<?> |
value
The class type of bean that should be checked.
|
public abstract Class<?> value
ApplicationContext
and a primary candidate
exists in case of multiple instances.
This attribute may not be used in conjunction with type()
, but it may be used instead of type()
.
public abstract String type
ApplicationContext
and a primary
candidate exists in case of multiple instances.
This attribute may not be used in conjunction with
value()
, but it may be used instead of value()
.
public abstract SearchStrategy search
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.