T
- the bean class of this synthetic beanpublic interface SyntheticBeanBuilder<T>
SyntheticComponents.addBean(Class)
.Modifier and Type | Method and Description |
---|---|
SyntheticBeanBuilder<T> |
alternative(boolean isAlternative)
Marks this synthetic bean as an alternative if desired.
|
SyntheticBeanBuilder<T> |
createWith(java.lang.Class<? extends SyntheticBeanCreator<T>> creatorClass)
Sets the class of the synthetic bean creation function.
|
SyntheticBeanBuilder<T> |
disposeWith(java.lang.Class<? extends SyntheticBeanDisposer<T>> disposerClass)
Sets the class of the synthetic bean destruction function.
|
SyntheticBeanBuilder<T> |
name(java.lang.String beanName)
Sets the bean name of this synthetic bean.
|
SyntheticBeanBuilder<T> |
priority(int priority)
Sets a priority of this synthetic bean.
|
SyntheticBeanBuilder<T> |
qualifier(java.lang.annotation.Annotation qualifierAnnotation)
Adds given annotation to the set of qualifiers of this synthetic bean.
|
SyntheticBeanBuilder<T> |
qualifier(AnnotationInfo qualifierAnnotation)
Adds given annotation to the set of qualifiers of this synthetic bean.
|
SyntheticBeanBuilder<T> |
qualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Adds a marker annotation of given type to the set of qualifiers of this synthetic bean.
|
SyntheticBeanBuilder<T> |
scope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
Sets the scope of this synthetic bean to given scope type.
|
SyntheticBeanBuilder<T> |
stereotype(java.lang.Class<? extends java.lang.annotation.Annotation> stereotypeAnnotation)
Adds
stereotypeAnnotation to the set of stereotypes of this synthetic bean. |
SyntheticBeanBuilder<T> |
stereotype(ClassInfo stereotypeAnnotation)
Adds
stereotypeAnnotation to the set of stereotypes of this synthetic bean. |
SyntheticBeanBuilder<T> |
type(java.lang.Class<?> type)
Adds
type to the set of bean types of this synthetic bean. |
SyntheticBeanBuilder<T> |
type(ClassInfo type)
Adds
type to the set of bean types of this synthetic bean. |
SyntheticBeanBuilder<T> |
type(Type type)
Adds
type to the set of bean types of this synthetic bean. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.annotation.Annotation value)
Adds an annotation-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.annotation.Annotation[] value)
Adds an annotation array-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
AnnotationInfo value)
Adds an annotation-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
AnnotationInfo[] value)
Adds an annotation array-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
boolean value)
Adds a
boolean -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
boolean[] value)
Adds a
boolean array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.Class<?> value)
Adds a
Class -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.Class<?>[] value)
Adds a
Class array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
ClassInfo value)
Adds a
Class -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
ClassInfo[] value)
Adds a
Class array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
double value)
Adds a
double -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
double[] value)
Adds a
double array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.Enum<?> value)
Adds an enum-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.Enum<?>[] value)
Adds an enum array-valued parameter to the parameter map.
|
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
int value)
Adds an
int -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
int[] value)
Adds an
int array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
long value)
Adds a
long -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
long[] value)
Adds a
long array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.String value)
Adds a
String -valued parameter to the parameter map. |
SyntheticBeanBuilder<T> |
withParam(java.lang.String key,
java.lang.String[] value)
Adds a
String array-valued parameter to the parameter map. |
SyntheticBeanBuilder<T> type(java.lang.Class<?> type)
type
to the set of bean types of this synthetic bean. This method may be called
multiple times to add multiple bean types.
If not called, the set of bean types of this synthetic bean will be a singleton set
containing java.lang.Object
.
type
- the bean type, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> type(ClassInfo type)
type
to the set of bean types of this synthetic bean. This method may be called
multiple times to add multiple bean types.
If not called, the set of bean types of this synthetic bean will be a singleton set
containing java.lang.Object
.
type
- the bean type, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> type(Type type)
type
to the set of bean types of this synthetic bean. This method may be called
multiple times to add multiple bean types.
If not called, the set of bean types of this synthetic bean will be a singleton set
containing java.lang.Object
.
type
- the bean type, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> qualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
If not called, this synthetic bean will have the @Default
qualifier
(and the @Any
qualifier that all beans have).
annotationType
- the type of the marker annotation, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> qualifier(AnnotationInfo qualifierAnnotation)
If not called, this synthetic bean will have the @Default
qualifier
(and the @Any
qualifier that all beans have).
qualifierAnnotation
- the annotation, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> qualifier(java.lang.annotation.Annotation qualifierAnnotation)
If not called, this synthetic bean will have the @Default
qualifier
(and the @Any
qualifier that all beans have).
qualifierAnnotation
- the annotation, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> scope(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation)
If not called, this synthetic bean will be @Dependent
.
scopeAnnotation
- the scope type, must not be null
SyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticBeanBuilder<T> alternative(boolean isAlternative)
alternative(true)
and priority(some priority)
.
If this synthetic bean is an alternative, not setting a priority means that it is not enabled, which is equivalent to not registering it at all.
If not called, this synthetic bean will not be an alternative.
isAlternative
- whether this synthetic bean should be an alternativeSyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticBeanBuilder<T> priority(int priority)
alternative(true)
and priority(some priority)
.
If this synthetic bean is an alternative, not setting a priority means that it is not enabled, which is equivalent to not registering it at all.
If not called, this synthetic bean will not have a priority. If this synthetic bean is not an alternative, the priority is ignored.
priority
- the priority of this synthetic beanSyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticBeanBuilder<T> name(java.lang.String beanName)
beanName
is null
,
this synthetic bean will not have a name.
If not called, this synthetic bean will not have a name.
beanName
- the bean name of this synthetic beanSyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticBeanBuilder<T> stereotype(java.lang.Class<? extends java.lang.annotation.Annotation> stereotypeAnnotation)
stereotypeAnnotation
to the set of stereotypes of this synthetic bean.
This method may be called multiple times to add multiple stereotypes.
If not called, this synthetic bean will have no stereotype.
stereotypeAnnotation
- the stereotype, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> stereotype(ClassInfo stereotypeAnnotation)
stereotypeAnnotation
to the set of stereotypes of this synthetic bean.
This method may be called multiple times to add multiple stereotypes.
If not called, this synthetic bean will have no stereotype.
stereotypeAnnotation
- the stereotype, must not be null
SyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, boolean value)
boolean
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, boolean[] value)
boolean
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, int value)
int
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, int[] value)
int
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, long value)
long
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, long[] value)
long
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, double value)
double
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, double[] value)
double
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.String value)
String
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.String[] value)
String
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.Enum<?> value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.Enum<?>[] value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.Class<?> value)
Class
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, ClassInfo value)
Class
-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.
When looked up from the parameter map in the creation/destruction function, the value will be
an instance of Class
, not a ClassInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.Class<?>[] value)
Class
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, ClassInfo[] value)
Class
array-valued parameter to the parameter map. The parameter map is passed
to the creation and destruction
functions when a bean instance is created/destroyed.
When looked up from the parameter map in the creation/destruction function, the values will be
instances of Class
, not ClassInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, AnnotationInfo value)
When looked up from the parameter map in the creation/destruction function, the value will be
an instance of the annotation type, not an AnnotationInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.annotation.Annotation value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, AnnotationInfo[] value)
When looked up from the parameter map in the creation/destruction function, the values will be
instances of the corresponding annotation types, not AnnotationInfo
.
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> withParam(java.lang.String key, java.lang.annotation.Annotation[] value)
key
- the parameter key, must not be null
value
- the parameter valueSyntheticBeanBuilder
SyntheticBeanBuilder<T> createWith(java.lang.Class<? extends SyntheticBeanCreator<T>> creatorClass)
public
and have
a public
zero-parameter constructor; it must not be a bean.
If not called, the synthetic bean registration will fail.
creatorClass
- the creation function class, must not be null
SyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple timesSyntheticBeanBuilder<T> disposeWith(java.lang.Class<? extends SyntheticBeanDisposer<T>> disposerClass)
public
and have
a public
zero-parameter constructor; it must not be a bean.
If not called, a noop destruction function will be used.
disposerClass
- the destruction function class, must not be null
SyntheticBeanBuilder
java.lang.IllegalStateException
- if this method is called multiple times