Added default bean name.
This commit is contained in:
parent
5514f2c7b0
commit
3275602da0
21 changed files with 30 additions and 24 deletions
|
|
@ -18,8 +18,16 @@ public interface BãßBȍőnNameʸᴰ<T, K extends BãßBȍőnCoffinStoreKeyʸ
|
|||
@BãßBȍőnꝐŕḯṿª₮ḕInit注(phase = BãßBȍőnꝐŕḯṿª₮ḕInitPhaseʸᴰ.BOON_PRE_BOOT)
|
||||
private static void init(BãßBȍőn<?,?> boon) {
|
||||
BãßBȍőnName注 anno = boon.getClass().getAnnotation(BãßBȍőnName注.class);
|
||||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_BEAN_NAME, anno!=null?anno.name():boon.getClass().getSimpleName());
|
||||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_BEAN_PURPOSE, anno!=null?anno.purpose():DEFAULT_BEAN_PURPOSE);
|
||||
String beanName = boon.getClass().getSimpleName();
|
||||
String beanPurpose = DEFAULT_BEAN_PURPOSE;
|
||||
if (anno != null && !anno.name().isBlank()) {
|
||||
beanName = anno.name();
|
||||
}
|
||||
if (anno != null && !anno.purpose().isBlank()) {
|
||||
beanPurpose = anno.purpose();
|
||||
}
|
||||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_BEAN_NAME, beanName);
|
||||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_BEAN_PURPOSE, beanPurpose);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import java.lang.annotation.Target;
|
|||
@Target({ElementType.TYPE})
|
||||
public @interface BãßBȍőnName注 {
|
||||
|
||||
String name();
|
||||
String name() default "";
|
||||
|
||||
String purpose();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue