Class MappingMethodOptions
java.lang.Object
org.mapstruct.ap.internal.model.source.MappingMethodOptions
Encapsulates all options specifiable on a mapping method
- Author:
- Andreas Gudian
-
Constructor Summary
ConstructorsConstructorDescriptionMappingMethodOptions(MapperOptions mapper, Set<MappingOptions> mappings, IterableMappingOptions iterableMapping, MapMappingOptions mapMapping, BeanMappingOptions beanMapping, EnumMappingOptions enumMappingOptions, List<ValueMappingOptions> valueMappings, Set<SubclassMappingOptions> subclassMappings, SubclassValidator subclassValidator) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyIgnoreAll(SourceMethod method, TypeFactory typeFactory, FormattingMessager messager) voidapplyInheritedOptions(SourceMethod sourceMethod, SourceMethod templateMethod, boolean isInverse, AnnotationMirror annotationMirror) Merges in all the mapping options configured, giving the already defined options precedence.static MappingMethodOptionsempty()creates empty mapping optionsstatic MappingMethodOptionsSubclassMappingOptions are not inherited to forged methods.static MappingMethodOptionsbooleanvoidvoidsetBeanMapping(BeanMappingOptions beanMapping) voidsetEnumMappingOptions(EnumMappingOptions enumMappingOptions) voidsetIterableMapping(IterableMappingOptions iterableMapping) voidsetMapMapping(MapMappingOptions mapMapping) voidsetValueMappings(List<ValueMappingOptions> valueMappings)
-
Constructor Details
-
MappingMethodOptions
public MappingMethodOptions(MapperOptions mapper, Set<MappingOptions> mappings, IterableMappingOptions iterableMapping, MapMappingOptions mapMapping, BeanMappingOptions beanMapping, EnumMappingOptions enumMappingOptions, List<ValueMappingOptions> valueMappings, Set<SubclassMappingOptions> subclassMappings, SubclassValidator subclassValidator)
-
-
Method Details
-
empty
creates empty mapping options- Returns:
- empty mapping options
-
getMappings
- Returns:
- the
MappingOptionss configured for this method, keyed by target property name. Only for enum mapping methods a target will be mapped by several sources.
-
getIterableMapping
-
getMapMapping
-
getBeanMapping
-
getEnumMappingOptions
-
getValueMappings
-
getSubclassMappings
-
setIterableMapping
-
setMapMapping
-
setBeanMapping
-
setEnumMappingOptions
-
setValueMappings
-
getMapper
-
isFullyInitialized
public boolean isFullyInitialized()- Returns:
- the
true, iff the options have been fully initialized by applying all available inheritance options
-
markAsFullyInitialized
public void markAsFullyInitialized() -
applyInheritedOptions
public void applyInheritedOptions(SourceMethod sourceMethod, SourceMethod templateMethod, boolean isInverse, AnnotationMirror annotationMirror) Merges in all the mapping options configured, giving the already defined options precedence.- Parameters:
sourceMethod- the method which inherits the options.templateMethod- the template method with the options to inherit, may benullisInverse- iftrue, the specified options are from an inverse methodannotationMirror- the annotation on which the compile errors will be shown.
-
applyIgnoreAll
public void applyIgnoreAll(SourceMethod method, TypeFactory typeFactory, FormattingMessager messager) -
getForgedMethodInheritedOptions
SubclassMappingOptions are not inherited to forged methods. They would result in an infinite loop if they were.- Returns:
- a MappingMethodOptions without SubclassMappingOptions or SubclassValidator.
-
getSubclassForgedMethodInheritedOptions
public static MappingMethodOptions getSubclassForgedMethodInheritedOptions(MappingMethodOptions options)
-