Package io.smallrye.beanbag
Class BeanBag.SupplierBuilder<T>
- java.lang.Object
-
- io.smallrye.beanbag.BeanBag.SupplierBuilder<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanBag.SupplierBuilder<T>addConstructorArgument(BeanSupplier<?> supplier)Add a general constructor argument injection.BeanBag.SupplierBuilder<T>addConstructorArgument(Class<?> injectType)Add a bean dependency constructor argument injection.BeanBag.SupplierBuilder<T>addConstructorArgument(Class<?> injectType, boolean optional)Add a bean dependency constructor argument injection.BeanBag.SupplierBuilder<T>addConstructorArgument(Class<?> injectType, String beanName)Add a bean dependency constructor argument injection.BeanBag.SupplierBuilder<T>addConstructorArgument(Class<?> injectType, String beanName, boolean optional)Add a bean dependency constructor argument injection.BeanBag.SupplierBuilder<T>addConstructorArgument(Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)Add a bean dependency constructor argument injection.BeanBag.BeanBuilder<T>build()Commit this supplier definition into the enclosing bean builder.BeanBag.SupplierBuilder<T>injectField(Field field)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectField(Field field, boolean optional)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectField(Field field, BeanSupplier<?> supplier)Add a general field injection.BeanBag.SupplierBuilder<T>injectField(Field field, Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectField(Field field, String beanName)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectField(Field field, String beanName, boolean optional)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectField(Field field, String beanName, boolean optional, DependencyFilter filter)Add a bean dependency field injection.BeanBag.SupplierBuilder<T>injectMethod(Method method)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, boolean optional)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, BeanSupplier<?> supplier)Add a general method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, String beanName)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, String beanName, boolean optional)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>injectMethod(Method method, String beanName, boolean optional, DependencyFilter filter)Add a bean dependency method injection.BeanBag.SupplierBuilder<T>setConstructor(Constructor<T> constructor)Set the constructor to use to instantiate the bean.
-
-
-
Method Detail
-
setConstructor
public BeanBag.SupplierBuilder<T> setConstructor(Constructor<T> constructor)
Set the constructor to use to instantiate the bean.- Parameters:
constructor- the constructor (must not benull)- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, BeanSupplier<?> supplier)
Add a general field injection.- Parameters:
field- the field to inject into (must not benull)supplier- the supplier of the field's value (must not benull)- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)
Add a bean dependency field injection.- Parameters:
field- the field to inject into (must not benull)injectType- the bean type to inject (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwisefilter- the filter to apply to determine whether a given bean should be included (must not benull)- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field)
Add a bean dependency field injection. The type of the bean is derived from the field's type.- Parameters:
field- the field to inject into (must not benull)- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, String beanName)
Add a bean dependency field injection. The type of the bean is derived from the field's type.- Parameters:
field- the field to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, boolean optional)
Add a bean dependency field injection. The type of the bean is derived from the field's type.- Parameters:
field- the field to inject into (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, String beanName, boolean optional)
Add a bean dependency field injection. The type of the bean is derived from the field's type.- Parameters:
field- the field to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
injectField
public BeanBag.SupplierBuilder<T> injectField(Field field, String beanName, boolean optional, DependencyFilter filter)
Add a bean dependency field injection. The type of the bean is derived from the field's type.- Parameters:
field- the field to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwisefilter- the filter to apply to determine whether a given bean should be included (must not benull)- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, BeanSupplier<?> supplier)
Add a general method injection.- Parameters:
method- the method to inject into (must not benull)supplier- the supplier of the method's value (must not benull)- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)
Add a bean dependency method injection.- Parameters:
method- the method to inject into (must not benull)injectType- the bean type to inject (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwisefilter- the filter to apply to determine whether a given bean should be included (must not benull)- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method)
Add a bean dependency method injection. The type of the bean is derived from the method's sole argument type.- Parameters:
method- the method to inject into (must not benull)- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, String beanName)
Add a bean dependency method injection. The type of the bean is derived from the method's sole argument type.- Parameters:
method- the method to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, boolean optional)
Add a bean dependency method injection. The type of the bean is derived from the method's sole argument type.- Parameters:
method- the method to inject into (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, String beanName, boolean optional)
Add a bean dependency method injection. The type of the bean is derived from the method's sole argument type.- Parameters:
method- the method to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
injectMethod
public BeanBag.SupplierBuilder<T> injectMethod(Method method, String beanName, boolean optional, DependencyFilter filter)
Add a bean dependency method injection. The type of the bean is derived from the method's sole argument type.- Parameters:
method- the method to inject into (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwisefilter- the filter to apply to determine whether a given bean should be included (must not benull)- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(BeanSupplier<?> supplier)
Add a general constructor argument injection.- Parameters:
supplier- the supplier of the argument's value (must not benull)- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(Class<?> injectType)
Add a bean dependency constructor argument injection.- Parameters:
injectType- the bean type to inject (must not benull)- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(Class<?> injectType, boolean optional)
Add a bean dependency constructor argument injection.- Parameters:
injectType- the bean type to inject (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(Class<?> injectType, String beanName)
Add a bean dependency constructor argument injection.- Parameters:
injectType- the bean type to inject (must not benull)beanName- the bean name to inject or""for any (must not benull)- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(Class<?> injectType, String beanName, boolean optional)
Add a bean dependency constructor argument injection.- Parameters:
injectType- the bean type to inject (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwise- Returns:
- this builder (not
null)
-
addConstructorArgument
public BeanBag.SupplierBuilder<T> addConstructorArgument(Class<?> injectType, String beanName, boolean optional, DependencyFilter filter)
Add a bean dependency constructor argument injection.- Parameters:
injectType- the bean type to inject (must not benull)beanName- the bean name to inject or""for any (must not benull)optional-trueto allownullto be injected, orfalseotherwisefilter- the filter to apply to determine whether a given bean should be included (must not benull)- Returns:
- this builder (not
null)
-
build
public BeanBag.BeanBuilder<T> build()
Commit this supplier definition into the enclosing bean builder. Any supplier previously set on the bean builder is overwritten.- Returns:
- the enclosing bean builder (not
null)
-
-