/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, name, qualifiers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, null, qualifiers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean */ public void registerBean(Class<?> annotatedClass) { doRegisterBean(annotatedClass, null, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, String name, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, name, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, null, qualifiers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean */ public void registerBean(Class<?> annotatedClass) { doRegisterBean(annotatedClass, null, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, name, qualifiers); }
@Override public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, @Nullable Supplier<T> supplier, BeanDefinitionCustomizer... customizers) { this.reader.doRegisterBean(beanClass, supplier, beanName, null, customizers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, String name, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, name, null); }
@Override public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, @Nullable Supplier<T> supplier, BeanDefinitionCustomizer... customizers) { this.reader.doRegisterBean(beanClass, supplier, beanName, null, customizers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, and optionally providing explicit constructor * arguments for consideration in the autowiring process. * @param beanName the name of the bean (may be {@code null}) * @param annotatedClass the class of the bean * @param constructorArguments argument values to be fed into Spring's * constructor resolution algorithm, resolving either all arguments or just * specific ones, with the rest to be resolved through regular autowiring * (may be {@code null} or empty) * @since 5.0 */ public <T> void registerBean(@Nullable String beanName, Class<T> annotatedClass, Object... constructorArguments) { this.reader.doRegisterBean(annotatedClass, null, beanName, null, bd -> { for (Object arg : constructorArguments) { bd.getConstructorArgumentValues().addGenericArgumentValue(arg); } }); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, and optionally providing explicit constructor * arguments for consideration in the autowiring process. * @param beanName the name of the bean (may be {@code null}) * @param annotatedClass the class of the bean * @param constructorArguments argument values to be fed into Spring's * constructor resolution algorithm, resolving either all arguments or just * specific ones, with the rest to be resolved through regular autowiring * (may be {@code null} or empty) * @since 5.0 */ public <T> void registerBean(@Nullable String beanName, Class<T> annotatedClass, Object... constructorArguments) { this.reader.doRegisterBean(annotatedClass, null, beanName, null, bd -> { for (Object arg : constructorArguments) { bd.getConstructorArgumentValues().addGenericArgumentValue(arg); } }); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, null, qualifiers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean */ public void registerBean(Class<?> annotatedClass) { doRegisterBean(annotatedClass, null, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations. * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param qualifiers specific qualifier annotations to consider, * in addition to qualifiers at the bean class level */ @SuppressWarnings("unchecked") public void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, name, qualifiers); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, null, null); }
/** * Register a bean from the given bean class, deriving its metadata from * class-declared annotations, using the given supplier for obtaining a new * instance (possibly declared as a lambda expression or method reference). * @param annotatedClass the class of the bean * @param name an explicit name for the bean * @param instanceSupplier a callback for creating an instance of the bean * (may be {@code null}) * @since 5.0 */ public <T> void registerBean(Class<T> annotatedClass, String name, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(annotatedClass, instanceSupplier, name, null); }
@Override public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, @Nullable Supplier<T> supplier, BeanDefinitionCustomizer... customizers) { this.reader.doRegisterBean(beanClass, supplier, beanName, null, customizers); }