public abstract class Vehicle{
private String vehicleName;
public class Vehicle(String vehicleName){
this.vehicleName = vehicleName;
}
public void drive();
}
@Component("Car")
public class Car implements vehicle(){
public Car(String carName){
super(carName);
}
}
Here, My requirement is i want to set object name dynamically, i.e. as per above code, my reference to Car class is going to the name which i pass to @Component, and i want reference to Car class to be carName property from Car class.
Kindly suggest if it is possible or not.
Note - I dont want @Component name to be from any properties file, i want it from my existing car object.