Package org.mapstruct
Class MappingConstants.ComponentModel
- java.lang.Object
-
- org.mapstruct.MappingConstants.ComponentModel
-
- Enclosing class:
- MappingConstants
public static final class MappingConstants.ComponentModel extends Object
Specifies the component model constants to which the generated mapper should adhere. It can be used with the annotationMapper.componentModel()
orMapperConfig.componentModel()
Example:
// Spring component model @Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
- Since:
- 1.5.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
CDI
The generated mapper is an application-scoped CDI bean and can be retrieved via @Inject.static String
DEFAULT
The mapper uses no component model, instances are typically retrieved viaMappers.getMapper(java.lang.Class)
static String
JAKARTA
The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.static String
JAKARTA_CDI
The generated mapper is an application-scoped Jakarta CDI bean and can be retrieved via @Inject.static String
JSR330
The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.static String
SPRING
The generated mapper is a Spring bean and can be retrieved via @Autowired
-
-
-
Field Detail
-
DEFAULT
public static final String DEFAULT
The mapper uses no component model, instances are typically retrieved viaMappers.getMapper(java.lang.Class)
- See Also:
- Constant Field Values
-
CDI
public static final String CDI
The generated mapper is an application-scoped CDI bean and can be retrieved via @Inject. The annotations are either fromjavax
orjakarta
. Priority have thejavax
annotations. In case you want to only use Jakarta then useJAKARTA_CDI
.- See Also:
JAKARTA_CDI
, Constant Field Values
-
SPRING
public static final String SPRING
The generated mapper is a Spring bean and can be retrieved via @Autowired- See Also:
- Constant Field Values
-
JSR330
public static final String JSR330
The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject. The annotations are either fromjavax.inject
orjakarta.inject
. Priority have thejavax.inject
annotations. In case you want to only use Jakarta then useJAKARTA
.- See Also:
JAKARTA
, Constant Field Values
-
JAKARTA
public static final String JAKARTA
The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject. The annotations are fromjakarta.inject
. In case you want to usejavax.inject
then useJSR330
.- See Also:
JSR330
, Constant Field Values
-
JAKARTA_CDI
public static final 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
-
-