Class SpringDIProcessor


  • public class SpringDIProcessor
    extends Object
    A simple processor that maps Spring DI annotations to CDI annotations. Arc's handling of annotation mapping (by creating an extra abstraction layer on top of the Jandex index) suits this sort of handling perfectly.
    • Field Detail

      • SPRING_COMPONENT

        static final org.jboss.jandex.DotName SPRING_COMPONENT
      • SPRING_SERVICE

        static final org.jboss.jandex.DotName SPRING_SERVICE
      • SPRING_REPOSITORY

        static final org.jboss.jandex.DotName SPRING_REPOSITORY
    • Constructor Detail

      • SpringDIProcessor

        public SpringDIProcessor()
    • Method Detail

      • registerFeature

        io.quarkus.deployment.builditem.FeatureBuildItem registerFeature()
      • getStereotypeScopes

        Map<org.jboss.jandex.DotName,​Set<org.jboss.jandex.DotName>> getStereotypeScopes​(org.jboss.jandex.IndexView index)
        Parameters:
        index - An index view of the archive including all the spring classes
        Returns:
        A map of any spring annotations extending @Component which will function like CDI stereotypes to any scopes it, or any of its stereotypes declared.
      • getAnnotationsToAdd

        Set<org.jboss.jandex.AnnotationInstance> getAnnotationsToAdd​(org.jboss.jandex.AnnotationTarget target,
                                                                     Map<org.jboss.jandex.DotName,​Set<org.jboss.jandex.DotName>> stereotypeScopes,
                                                                     List<org.jboss.jandex.DotName> allArcScopes)
        Map spring annotations from an annotated class to equivalent CDI annotations
        Parameters:
        target - The annotated class
        stereotypeScopes - A map on spring stereotype classes to all the scopes they, or any of their stereotypes (etc.) declare
        Returns:
        The CDI annotations to add to the class