注解 @AutoConfigureBefore 和 @AutoConfigureAfter 的用途


注解 @AutoConfigureBefore 和 @AutoConfigureAfter 的用途

介紹:

如果你想將在SpringBoot項目中的配置類進行排序,那么用到spring-boot-autoconfigure 包下的@AutoConfigureBefore 和 @AutoConfigureAfter注解

用法:

@AutoConfigureBefore(A.class) 或 AutoConfigureBefore({A.class, B.class})

@AutoConfigureBefore(A.class)
public class C {
}

說明

C 將會在 A 之前加載

用法:

@AutoConfigureAfter(A.class) 或 AutoConfigureAfter({A.class, B.class})

@AutoConfigureAfter(A.class)
public class C{
}

說明

C將會在A之后加載


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM