Spring annotations article (#4232)

* Spring annotations

* commented VehicleFactoryApplication to fix CI build
This commit is contained in:
fanatixan
2018-05-12 22:43:12 +02:00
committed by maibin
parent 5c4fe46ea2
commit 506962bc96
16 changed files with 301 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package com.baeldung.annotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
@Component
public class Biker {
@Autowired
@Qualifier("bike")
private Vehicle vehicle;
@Autowired
public Biker(@Qualifier("bike") Vehicle vehicle) {
this.vehicle = vehicle;
}
@Autowired
public void setVehicle(@Qualifier("bike") Vehicle vehicle) {
this.vehicle = vehicle;
}
}