44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
package com.imyeyu.inject.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;
|
||
|
||
/**
|
||
* 此注解使用在方法上,TimiInject 完成注入后自动执行,对 {@link StaticInject} 和 {@link SuperInject} 有效,方法访问权限无限制。
|
||
* <p>注意:{@link StaticInject} 注解类的方法使用此注解时,该方法也必须是静态方法
|
||
*
|
||
* <pre>
|
||
* @Component
|
||
* public class Demo {
|
||
*
|
||
* @InvokeForInjected
|
||
* public void hello() {
|
||
* System.out.println("hello");
|
||
* }
|
||
*
|
||
* @InvokeForInjected
|
||
* public void timiInject() {
|
||
* System.out.println("timi-inject");
|
||
* }
|
||
* }
|
||
* </pre>
|
||
*
|
||
* @author 夜雨
|
||
* @version 2022-09-23 22:25
|
||
*/
|
||
@Target({ElementType.METHOD})
|
||
@Retention(RetentionPolicy.RUNTIME)
|
||
@Documented
|
||
public @interface InvokeForInjected {
|
||
|
||
/**
|
||
* 执行顺序,默认 0,数值小的先执行
|
||
*
|
||
* @return 执行顺序
|
||
*/
|
||
int value() default 0;
|
||
}
|