Suppose I have interfaces such as these:
interface Country {}
class USA implements Country {}
class UK implements Country ()
And this snippet of configuration xml:
<bean class="USA"/>
<bean id="country" class="UK"/>
<bean id="main" class="Main"/>
How can I control which dependency is autowired below? I'd like the UK one.
class Main {
private Country country;
@Autowired
public void setCountry(Country country) {
this.country = country;
}
}
I am using Spring 3.0.3.RELEASE.