我有 2 节课:
@Component("baseWebElement")
@Scope("prototype")
@Lazy(true)
public class BaseWebElement implements IBaseWebElement{
@Autowired
private IContextBrowserDriver browserDriver;
private String locator;
@Autowired
public BaseWebElement(String locator) {
this.setLocator(locator);
}
...
和:
@Component("webLink")
@Scope("prototype")
@Lazy(true)
public class WebLink implements IUILink, ApplicationContextAware {
private ApplicationContext applicationContext = null;
@Autowired
private IBaseWebElement baseWebElement;
public WebLink(String locator) {
}
...
如您所见,我想在 WebLink 类中使用 BaseWebElement。它们都有一个具有相同参数的构造函数。(定位器)
我想将 WebLink 构造函数参数传递给 BaseWebLink 构造函数。
如何正确使用 Java Spring 注释执行此操作?
谢谢