Class RepeatableAnnotations<SINGULAR extends org.mapstruct.tools.gem.Gem,MULTIPLE extends org.mapstruct.tools.gem.Gem,OPTIONS>

java.lang.Object
org.mapstruct.ap.internal.util.RepeatableAnnotations<SINGULAR,MULTIPLE,OPTIONS>
Type Parameters:
SINGULAR - The singular annotation type
MULTIPLE - The multiple annotation type
OPTIONS - The underlying holder for the processed annotations
Direct Known Subclasses:
AdditionalAnnotationsBuilder

public abstract class RepeatableAnnotations<SINGULAR extends org.mapstruct.tools.gem.Gem,MULTIPLE extends org.mapstruct.tools.gem.Gem,OPTIONS> extends Object
A base helper class that provides utility methods for working with repeatable annotations.
Author:
Ben Zegveld
  • Constructor Details

    • RepeatableAnnotations

      protected RepeatableAnnotations(ElementUtils elementUtils, String singularFqn, String multipleFqn)
  • Method Details

    • singularInstanceOn

      protected abstract SINGULAR singularInstanceOn(Element element)
      Parameters:
      element - the element on which the Gem needs to be found
      Returns:
      the Gem found on the element.
    • multipleInstanceOn

      protected abstract MULTIPLE multipleInstanceOn(Element element)
      Parameters:
      element - the element on which the Gems needs to be found
      Returns:
      the Gems found on the element.
    • addInstance

      protected abstract void addInstance(SINGULAR gem, Element source, Set<OPTIONS> mappings)
      Parameters:
      gem - the annotation gem to be processed
      source - the source element where the request originated from
      mappings - the collection of completed processing
    • addInstances

      protected abstract void addInstances(MULTIPLE gems, Element source, Set<OPTIONS> mappings)
      Parameters:
      gems - the annotation gems to be processed
      source - the source element where the request originated from
      mappings - the collection of completed processing
    • getProcessedAnnotations

      public Set<OPTIONS> getProcessedAnnotations(Element source)
      Retrieves the processed annotations.
      Parameters:
      source - The source element of interest
      Returns:
      The processed annotations for the given element