Class AnnotationBasedComponentModelProcessor

    • Constructor Detail

      • AnnotationBasedComponentModelProcessor

        public AnnotationBasedComponentModelProcessor()
    • Method Detail

      • process

        public Mapper process​(ModelElementProcessor.ProcessorContext context,
                              TypeElement mapperTypeElement,
                              Mapper mapper)
        Description copied from interface: ModelElementProcessor
        Processes the given source element, representing a Java bean mapper in one form or another.
        Specified by:
        process in interface ModelElementProcessor<Mapper,​Mapper>
        context - Context providing common infrastructure objects.
        mapperTypeElement - The original type element from which the given mapper object is derived.
        mapper - The current representation of the bean mapper. Never null (the very first processor receives the original type element).
        The resulting representation of the bean mapper; may be the same as the source representation, e.g. if a given implementation just performs some sort of validity check. Implementations must never return null except for the very last processor which generates the resulting Java source file.
      • adjustDecorator

        protected void adjustDecorator​(Mapper mapper,
                                       org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy)
      • additionalPublicEmptyConstructor

        protected boolean additionalPublicEmptyConstructor()
      • getDelegatorReferenceAnnotations

        protected List<Annotation> getDelegatorReferenceAnnotations​(Mapper mapper)
      • replacementMapperReference

        protected Field replacementMapperReference​(Field originalReference,
                                                   List<Annotation> annotations,
                                                   org.mapstruct.ap.internal.gem.InjectionStrategyGem injectionStrategy)
        originalReference - the reference to be replaced
        annotations - the list of annotations
        injectionStrategy - strategy for injection
        the mapper reference replacing the original one
      • getComponentModelIdentifier

        protected abstract String getComponentModelIdentifier()
        the component model identifier
      • getTypeAnnotations

        protected abstract List<Annotation> getTypeAnnotations​(Mapper mapper)
        mapper - the mapper
        the annotation(s) to be added at the mapper type implementation
      • getDecoratorAnnotations

        protected List<Annotation> getDecoratorAnnotations()
        the annotation(s) to be added at the decorator of the mapper
      • getMapperReferenceAnnotations

        protected abstract List<Annotation> getMapperReferenceAnnotations()
        the annotation of the field for the mapper reference
      • requiresGenerationOfDecoratorClass

        protected abstract boolean requiresGenerationOfDecoratorClass()
        if a decorator (sub-)class needs to be generated or not
      • getPriority

        public int getPriority()
        Description copied from interface: ModelElementProcessor
        Returns the priority value of this processor which must be between 1 (highest priority) and 10000 (lowest priority). Processors are invoked in order from highest to lowest priority, starting with the mapping method retrieval processor (priority 1) and finishing with the code generation processor (priority 10000). Processors working on the built Mapper model must have a priority > 1000.
        Specified by:
        getPriority in interface ModelElementProcessor<Mapper,​Mapper>
        The priority value of this processor.
      • getTypeFactory

        protected TypeFactory getTypeFactory()