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

org.noear.solon.annotation.Bean Maven / Gradle / Ivy

There is a newer version: 3.0.5-M3
Show newest version
package org.noear.solon.annotation;

import java.lang.annotation.*;

/**
 * 通用 组件
 *
 * 

 * //注解在配置器的函数上
 * @Configuration
 * public class Config{
 *     @Bean
 *     public DataSource db1(@Inject("${db1}") HikariDataSource ds){
 *         return ds;
 *     }
 * }
 * 
* * @author noear * @since 1.0 * */ @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Bean { @Note("注册名称") String value() default ""; //as bean.name @Note("标签,用于快速查找") String tag() default ""; @Note("特性,用于辅助配置") String[] attrs() default {}; @Note("同时注册类型,仅当名称非空时有效") boolean typed() default false; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy