All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.datalking.annotation.Autowired Maven / Gradle / Ivy

package com.github.datalking.annotation;

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;

/**
 * 标注为需要自动装配的bean
 * 类似于jsr的@Inject
 * 装配bean时默认by type
 *
 * @author yaoo on 4/2/18
 */
@Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Autowired {

    // 默认依赖的对象必须存在
    boolean required() default true;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy