-
Notifications
You must be signed in to change notification settings - Fork 38k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MergedAnnotation meta-data support #22909
Commits on May 6, 2019
-
Extract integration test classes from package-info
Extract the inner classes from package-info into their own files to prevent local build problems and to make them easier to find.
Configuration menu - View commit details
-
Copy full SHA for 979eb2b - Browse repository at this point
Copy the full SHA 979eb2bView commit details -
Add MergedAnnotation.getTypeHierarchy method
Add a `getTypeHierarchy()` method to `MergedAnnotation` that can be used to return the full type hierarchy information. This method is specifically designed to be used in combination with `MergedAnnotationPredicates.unique`. This update also allows us to delete the `parentAndType` method from `AnnotatedElementUtils`. Closes spring-projectsgh-22908
Configuration menu - View commit details
-
Copy full SHA for 969cc19 - Browse repository at this point
Copy the full SHA 969cc19View commit details -
Rename some MergedAnnotation
from
methods toof
Rename `from` to `of` for the `MergedAnnotation` factory methods that work with Maps. The previous name was a little confusing, especially when an annotation source parameter was specified. The new method name helps to make it clearer when the user is explicitly defining the attributes of the annotation, as opposed to picking them up from the source.
Configuration menu - View commit details
-
Copy full SHA for 1fa806e - Browse repository at this point
Copy the full SHA 1fa806eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e6ab8a1 - Browse repository at this point
Copy the full SHA e6ab8a1View commit details -
Support String->Class adaptation in MergedAnnotation
Update TypeMappedAnnotation so that Strings can be used to represent Class attribute values. This will allow ASM annotation readers to present a `MergedAnnotation` instance without necessarily having the actual class values on the classpath. When the underlying value is a String, any calls to `getValue(name, String.class)` or `asMap(Adapt.CLASS_TO_STRING)` will simply return the original String. Calls that need the actual Class result (such as `getClass`) will use `Class.forName` and may throw a `ClassNotFoundException` at that point. This commit also allows an empty Object[] to be used to represent any empty primitive array. See spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 77cd957 - Browse repository at this point
Copy the full SHA 77cd957View commit details -
Add MergedAnnotations.of method
Add a factory method to `MergedAnnotation` that allows an instance to be created for an explicit collection of root annotations. This method will allow ASM based readers to expose a `MergedAnnotation` instance that has root annotations loaded from bytecode, and meta-annotations loaded using reflection. See spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 9bd6cc1 - Browse repository at this point
Copy the full SHA 9bd6cc1View commit details -
Don't expose RetentionPolicy.CLASS annotations
Update ASM based metadata readers so that only RetentionPolicy.RUNTIME annotations are exposed. This aligned behavior with the reflection based implementation. Closes spring-projectsgh-22886
Configuration menu - View commit details
-
Copy full SHA for f4519b4 - Browse repository at this point
Copy the full SHA f4519b4View commit details -
Skip java.lang.annotations when reading metadata
Update `StandardAnnotationMetadata` and `AnnotationMetadataReadingVisitor` so that `java.lang.annotation` annotations are consistently skipped. Closes spring-projectsgh-22885
Configuration menu - View commit details
-
Copy full SHA for 71c62c7 - Browse repository at this point
Copy the full SHA 71c62c7View commit details -
Use ReflectionUtils to get declared methods
Update `StandardAnnotationMetadata` to use `ReflectionUtils` when obtaining declared methods. This update is primarily so that the common method cache can be used. Closes spring-projectsgh-22907
Configuration menu - View commit details
-
Copy full SHA for 6ccf7f0 - Browse repository at this point
Copy the full SHA 6ccf7f0View commit details -
Add additional class/method meta-data tests
Add some additional tests to provide more coverage of class and method meta-data support. See spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 86c4f96 - Browse repository at this point
Copy the full SHA 86c4f96View commit details -
Reduce meta-data code duplicate with default methods
Extract and pull-up some common method implementations and make them default methods of the interface. See spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 8717ba4 - Browse repository at this point
Copy the full SHA 8717ba4View commit details -
Add MergedAnnotations support to meta-data classes
Add `AnnotatedTypeMetaData.getAnnotations()` that can be used to access annotation details using the `MergedAnnotations` interface. Where possible, the existing annotation methods have been migrated to call `getAnnotation()`, rather than needing their own implementation. The existing ASM based meta-data implementations have not been updated since they will be deprecated and replaced in a subsequent commit. See spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 5c00cc3 - Browse repository at this point
Copy the full SHA 5c00cc3View commit details -
Add SimpleAnnotationMeta classes and readers
Replace the existing ASM based readers with new implementations that also support MergedAnnotations. The meta-data classes themselves are now immutable, and constructed via separate reader classes. The `SimpleMetadataReader` class has been updated to return the new classes, however the old ones remain since some of them are public and might be being used directly. Closes spring-projectsgh-22884
Configuration menu - View commit details
-
Copy full SHA for 4e25363 - Browse repository at this point
Copy the full SHA 4e25363View commit details -
Deprecate StandardMetadata constructors
Deprecate the public `StandardMetadata` constructors to make it clearer that these classes should not be instantiated directly. A new `AnnotationMetadata.introspect` factory method has been added which can now be used to obtain instances. This change will allow use to make the constructors package private and drop the `nestedAnnotationsAsMap` parameter in a future release. Closes spring-projectsgh-22906