-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support type annotations for Java & Groovy (#8764)
Introduced a way to access type annotations on ClassElement#getTypeAnnotationMetadata. To do that the native type has to carry the actual type mirror (for Java). If the type mirror is present that indicates that ClassElement supports type annotations and the actual annotation metadata of the class is a hierarchy of both. Modifying annotation metadata of such class will modify the type annotations, modifying the actual class annotation can be done on the #getType class element. The type annotations are now the ones that are persisted for an executable method's return type, parameters, and type parameters. There is no need for hacks to persist generic type annotations in some cases. There is some modification to how the generic placeholders are preserved bound to make sure everything works correctly. Added a lot of tests to test annotating methods, return types, parameters, fields, and field types.
- Loading branch information
Showing
103 changed files
with
6,696 additions
and
1,150 deletions.
There are no files selected for viewing
500 changes: 239 additions & 261 deletions
500
...essor/src/main/java/io/micronaut/inject/annotation/AbstractAnnotationMetadataBuilder.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
31 changes: 31 additions & 0 deletions
31
...r/src/main/java/io/micronaut/inject/ast/annotation/AbstractElementAnnotationMetadata.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,31 @@ | ||
/* | ||
* Copyright 2017-2020 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.inject.ast.annotation; | ||
|
||
import io.micronaut.core.annotation.AnnotationMetadata; | ||
import io.micronaut.core.annotation.Internal; | ||
|
||
/** | ||
* Mutable annotation metadata provider. | ||
* | ||
* @author Denis Stepanov | ||
* @since 4.0.0 | ||
*/ | ||
@Internal | ||
public abstract class AbstractElementAnnotationMetadata | ||
extends AbstractMutableAnnotationMetadata<AnnotationMetadata> | ||
implements ElementAnnotationMetadata { | ||
} |
Oops, something went wrong.