Package org.mapstruct

Class MappingConstants.ComponentModel

  • Enclosing class:
    MappingConstants

    public static final class MappingConstants.ComponentModel
    extends java.lang.Object
    Specifies the component model constants to which the generated mapper should adhere. It can be used with the annotation Mapper.componentModel() or MapperConfig.componentModel()

    Example:

    
     // Spring component model
     @Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
     
    Since:
    1.5.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CDI
      The generated mapper is an application-scoped CDI bean and can be retrieved via @Inject.
      static java.lang.String DEFAULT
      The mapper uses no component model, instances are typically retrieved via Mappers.getMapper(java.lang.Class)
      static java.lang.String JAKARTA
      The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.
      static java.lang.String JAKARTA_CDI
      The generated mapper is an application-scoped Jakarta CDI bean and can be retrieved via @Inject.
      static java.lang.String JSR330
      The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.
      static java.lang.String SPRING
      The generated mapper is a Spring bean and can be retrieved via @Autowired
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ComponentModel()  
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CDI

        public static final java.lang.String CDI
        The generated mapper is an application-scoped CDI bean and can be retrieved via @Inject. The annotations are either from javax or jakarta. Priority have the javax annotations. In case you want to only use Jakarta then use JAKARTA_CDI.
        See Also:
        JAKARTA_CDI, Constant Field Values
      • SPRING

        public static final java.lang.String SPRING
        The generated mapper is a Spring bean and can be retrieved via @Autowired
        See Also:
        Constant Field Values
      • JSR330

        public static final java.lang.String JSR330
        The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject. The annotations are either from javax.inject or jakarta.inject. Priority have the javax.inject annotations. In case you want to only use Jakarta then use JAKARTA.
        See Also:
        JAKARTA, Constant Field Values
      • JAKARTA

        public static final java.lang.String JAKARTA
        The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject. The annotations are from jakarta.inject. In case you want to use javax.inject then use JSR330.
        See Also:
        JSR330, Constant Field Values
      • JAKARTA_CDI

        public static final java.lang.String JAKARTA_CDI
        The generated mapper is an application-scoped Jakarta CDI bean and can be retrieved via @Inject.
        See Also:
        CDI, Constant Field Values
    • Constructor Detail

      • ComponentModel

        private ComponentModel()