By default, dependencies marked with the @Autowired annotation are treated as required.
默认地,标有@Autowired注解的依赖被认为是必须的。
For example, the excerpt below depicts a field that should be autowired with a qualified candidate among those that match by type.
例如,下面这个摘录则描绘了一个域,它应该和通过名字匹配得到的结果中合格的对象进行自动装配。
In fact, autowired methods do not have to be 'setter' methods and can even accept multiple parameters. The following is perfectly acceptable.
实际上,aotowired方法并不一定要是setter方法,且可以接受多个参数。
To use this service in an application, all we need to do is to use Spring's autowire mechanism and annotate fields where this bean should be injected with @Autowired annotation.
要在应用中使用该服务,我们只需利用Spring的自动装配(autowire)机制,在需要注入该服务的属性上使用@Autowired注解就可以了。