我有两个带有注释的类/bean @Configuration,我必须根据属性文件中的值进行实例化。
@Configuration
public class RemoteServer1 {
//some authentication logic goes here
}
Run Code Online (Sandbox Code Playgroud)
@Configuration
public class RemoteServer2 {
//some authentication logic goes here
}
Run Code Online (Sandbox Code Playgroud)
remote.server.location=RemoteServer1
Run Code Online (Sandbox Code Playgroud)
现在我想实例化@Configuration与属性文件中的值匹配的类/bean。