-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve extension API documentation and resolve some open questions
- modified the `@Processing` phase to also execute for synthetic beans and observers, after `@Synthesis` is finished - added annotation transformations for method parameters (`ParameterConfig`) - changed `ArrayType` to use a component type representation, instead of a representation with element type + number of dimensions - clarified what happens with non-existing annotation members defined using `AnnotationBuilder` in the resulting `AnnotationInfo` - clarified the set of error conditions for `Types.ofArray()` - settled on the current design for `Parameters`, removed the comment that outlines another possible design - removed some TODOs where alternative design options exist, but they have no obvious advantage (one design simply has to be chosen)
- Loading branch information
Showing
15 changed files
with
138 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
api/src/main/java/jakarta/enterprise/inject/build/compatible/spi/ParameterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package jakarta.enterprise.inject.build.compatible.spi; | ||
|
||
import jakarta.enterprise.lang.model.AnnotationInfo; | ||
import jakarta.enterprise.lang.model.declarations.ParameterInfo; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.function.Predicate; | ||
|
||
/** | ||
* Allows adding annotations to and removing annotations from a method parameter. | ||
* Note that the method parameter is not physically altered, the modifications | ||
* are only seen by the CDI container. | ||
* | ||
* @see Enhancement | ||
* @since 4.0 | ||
*/ | ||
public interface ParameterConfig extends DeclarationConfig { | ||
/** | ||
* Returns the {@link ParameterInfo} corresponding to this transformed method parameter. | ||
* | ||
* @return the {@link ParameterInfo} corresponding to this transformed method parameter, never {@code null} | ||
*/ | ||
@Override | ||
ParameterInfo info(); | ||
|
||
/** | ||
* Adds a marker annotation of given type to this method parameter. | ||
* Does not allow configuring annotation members. | ||
* | ||
* @param annotationType the annotation type, must not be {@code null} | ||
* @return this configurator object, to allow fluent usage | ||
*/ | ||
@Override | ||
ParameterConfig addAnnotation(Class<? extends Annotation> annotationType); | ||
|
||
/** | ||
* Adds given annotation to this method parameter. The {@link AnnotationInfo} can be obtained | ||
* from an annotation target, or constructed from scratch using {@link AnnotationBuilder}. | ||
* | ||
* @param annotation the annotation to add to this method parameter, must not be {@code null} | ||
* @return this configurator object, to allow fluent usage | ||
*/ | ||
@Override | ||
ParameterConfig addAnnotation(AnnotationInfo annotation); | ||
|
||
/** | ||
* Adds given annotation to this method parameter. The annotation instance is typically | ||
* a subclass of {@link jakarta.enterprise.util.AnnotationLiteral AnnotationLiteral}. | ||
* | ||
* @param annotation the annotation to add to this method parameter, must not be {@code null} | ||
* @return this configurator object, to allow fluent usage | ||
*/ | ||
@Override | ||
ParameterConfig addAnnotation(Annotation annotation); | ||
|
||
/** | ||
* Removes all annotations matching given predicate from this method parameter. | ||
* | ||
* @param predicate an annotation predicate, must not be {@code null} | ||
* @return this configurator object, to allow fluent usage | ||
*/ | ||
@Override | ||
ParameterConfig removeAnnotation(Predicate<AnnotationInfo> predicate); | ||
|
||
/** | ||
* Removes all annotations from this method parameter. | ||
* | ||
* @return this configurator object, to allow fluent usage | ||
*/ | ||
@Override | ||
ParameterConfig removeAllAnnotations(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 19 additions & 19 deletions
38
api/src/main/java/jakarta/enterprise/lang/model/types/ArrayType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.