I got the initial integration of annotation information done. I'll be pushing that soon too if you get a chance to look. I just exposed the Jandex info directly as I did not want to waste the memory to duplicate that. So, for example, ClassDescriptor#getAnnotations returns a Map<DotName,AnnotationInstance>, AnnotationInstance then segues into the Jandex objects. Not ideal, but the best option until Jandex incorporates this info.
Is this not a bit inconsistent? Partly we are dealing with org.hibernate.metamodel.reflite.spi.Name and partly with DotName. I think I would prefer a model where Jandex is completely hidden behind reflite. I feel exposing Jandex like this when it comes to annotation somehow breaks encapsulation.
What the current API is missing afaics is a way to find all annotation of a given type like in org.jboss.jandex.Index#getAnnotations(DotName). I guess this ties into my preference to completely hide Jandex, in which case I would probably add another spi class to org.hibernate.metamodel.reflite.spi.
|