Skip to content

Commit

Permalink
add SyntheticBeanBuilder.withInjectionPoint()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladicek committed Jan 14, 2025
1 parent c057683 commit 039589f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Instances are not reusable. For each synthetic bean, new instance
* must be created by {@link SyntheticComponents#addBean(Class)}.
*
* @param <T> the bean class of this synthetic bean
* @param <T> the implementation class of this synthetic bean
* @since 4.0
*/
public interface SyntheticBeanBuilder<T> {
Expand Down Expand Up @@ -435,6 +435,58 @@ public interface SyntheticBeanBuilder<T> {
*/
SyntheticBeanBuilder<T> withParam(String key, InvokerInfo[] value);

/**
* Declares that the creation or destruction function for this synthetic bean will potentially
* look up a bean of given {@code type} with given {@code qualifiers}.
* <p>
* The registered injection points will be validated.
*
* @param type the type of the bean that may be looked up in the creation/destruction function
* @param qualifiers the qualifiers of the bean that may be looked up in the creation/destruction function
* @return this {@code SyntheticBeanBuilder}
* @since 5.0
*/
SyntheticBeanBuilder<T> withInjectionPoint(Class<?> type, Annotation... qualifiers);

/**
* Declares that the creation or destruction function for this synthetic bean will potentially
* look up a bean of given {@code type} with given {@code qualifiers}.
* <p>
* The registered injection points will be validated.
*
* @param type the type of the bean that may be looked up in the creation/destruction function
* @param qualifiers the qualifiers of the bean that may be looked up in the creation/destruction function
* @return this {@code SyntheticBeanBuilder}
* @since 5.0
*/
SyntheticBeanBuilder<T> withInjectionPoint(Class<?> type, AnnotationInfo... qualifiers);

/**
* Declares that the creation or destruction function for this synthetic bean will potentially
* look up a bean of given {@code type} with given {@code qualifiers}.
* <p>
* The registered injection points will be validated.
*
* @param type the type of the bean that may be looked up in the creation/destruction function
* @param qualifiers the qualifiers of the bean that may be looked up in the creation/destruction function
* @return this {@code SyntheticBeanBuilder}
* @since 5.0
*/
SyntheticBeanBuilder<T> withInjectionPoint(Type type, Annotation... qualifiers);

/**
* Declares that the creation or destruction function for this synthetic bean will potentially
* look up a bean of given {@code type} with given {@code qualifiers}.
* <p>
* The registered injection points will be validated.
*
* @param type the type of the bean that may be looked up in the creation/destruction function
* @param qualifiers the qualifiers of the bean that may be looked up in the creation/destruction function
* @return this {@code SyntheticBeanBuilder}
* @since 5.0
*/
SyntheticBeanBuilder<T> withInjectionPoint(Type type, AnnotationInfo... qualifiers);

/**
* Sets the class of the synthetic bean {@linkplain SyntheticBeanCreator creation} function.
* CDI container will create an instance of the creation function every time when it needs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* to obtain an instance of the synthetic bean. Implementations must be {@code public}
* classes with a {@code public} zero-parameter constructor; they must not be beans.
*
* @param <T> the bean class of the synthetic bean
* @param <T> the implementation class of the synthetic bean
* @since 4.0
*/
public interface SyntheticBeanCreator<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* to destroy an instance of the synthetic bean. Implementations must be {@code public}
* classes with a {@code public} zero-parameter constructor; they must not be beans.
*
* @param <T> the bean class of the synthetic bean
* @param <T> the implementation class of the synthetic bean
* @since 4.0
*/
public interface SyntheticBeanDisposer<T> {
Expand Down

0 comments on commit 039589f

Please # to comment.