Package org.mapstruct
Class MappingConstants.ComponentModel
java.lang.Object
org.mapstruct.MappingConstants.ComponentModel
- Enclosing class:
MappingConstants
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
FieldsModifier and TypeFieldDescriptionstatic final StringThe generated mapper is an application-scoped CDI bean and can be retrieved via @Inject.static final StringThe mapper uses no component model, instances are typically retrieved viaMappers.getMapper(java.lang.Class)static final StringThe generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.static final StringThe generated mapper is an application-scoped Jakarta CDI bean and can be retrieved via @Inject.static final StringThe generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject.static final StringThe generated mapper is a Spring bean and can be retrieved via @Autowired -
Method Summary
-
Field Details
-
DEFAULT
The mapper uses no component model, instances are typically retrieved viaMappers.getMapper(java.lang.Class)- See Also:
-
CDI
The generated mapper is an application-scoped CDI bean and can be retrieved via @Inject. The annotations are either fromjavaxorjakarta. Priority have thejavaxannotations. In case you want to only use Jakarta then useJAKARTA_CDI.- See Also:
-
SPRING
The generated mapper is a Spring bean and can be retrieved via @Autowired- See Also:
-
JSR330
The generated mapper is annotated with @Named and @Singleton, and can be retrieved via @Inject. The annotations are either fromjavax.injectorjakarta.inject. Priority have thejavax.injectannotations. In case you want to only use Jakarta then useJAKARTA.- See Also:
-
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.injectthen useJSR330.- See Also:
-
JAKARTA_CDI
The generated mapper is an application-scoped Jakarta CDI bean and can be retrieved via @Inject.- See Also:
-