Uses a mix of Jandex and Java reflection to build the de-typed abstraction model of classes and annotations referenced by an application’s managed resources[1].
Consumers can then access details from that abstraction model in a unified way, regardless of the underlying source. For classes which we are able to access from a Jandex index, this has the benefit that the classes are not loaded into the ClassLoader which is important because once a classes is loaded into a ClassLoader, its bytecode cannot be changed and run-time bytecode enhancement is not possible.
This work is intended to replace the hibernate-commons-annotation (HCANN)
library, which suffered from a number of shortcomings.
The modeling of annotations in hibernate-models is defined by a few main actors:
- AnnotationDescriptor
-
Extended information about an annotation class
- AnnotationTarget
-
Something (Class, Method, …) where an annotation can be used
- AnnotationUsage
-
Specific usage of an annotation on a target
- AttributeDescriptor
-
Details about an annotation attribute, including it’s
ValueTypeDescriptor - ValueTypeDescriptor
-
Describes an allowable type for annotation attributes - ints, enums, etc. Provides the capability to manipulate these values (create them, wrap them, unwrap them, etc).
- AnnotationDescriptorRegistry
-
registry of
AnnotationDescriptorreferences
These mostly model Java constructs such as Class, Method, etc. but adds the capability for these to be dynamic models (no physical Class).
- ClassDetails
-
Think
java.lang.Class - TypeDetails
-
Think
java.lang.reflect.Type - MemberDetails
-
Think
java.lang.reflect.Member - FieldDetails
-
Think
java.lang.reflect.Field - MethodDetails
-
Think
java.lang.reflect.Method - RecordComponentDetails
-
Think
java.lang.reflect.RecordComponent - ClassDetailsRegistry
-
registry of
ClassDetailsreferences