com.jquicker.annotation.ioc.Autowired Maven / Gradle / Ivy
package com.jquicker.annotation.ioc;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Autowired {
/**
* 使用@Autowired 时,如果找到多个同一类型的bean,则会抛异常,
* 此时可以使用 @Qualifier("beanName"),明确指定bean的名称进行注入,此时与 @Resource指定name属性作用相同
*/
boolean required() default true;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy