Class MappingMethodOptions
- java.lang.Object
-
- org.mapstruct.ap.internal.model.source.MappingMethodOptions
-
public class MappingMethodOptions extends Object
Encapsulates all options specifiable on a mapping method- Author:
- Andreas Gudian
-
-
Constructor Summary
Constructors Constructor Description MappingMethodOptions(MapperOptions mapper, Set<MappingOptions> mappings, IterableMappingOptions iterableMapping, MapMappingOptions mapMapping, BeanMappingOptions beanMapping, EnumMappingOptions enumMappingOptions, List<ValueMappingOptions> valueMappings, Set<SubclassMappingOptions> subclassMappings, SubclassValidator subclassValidator)
-
Method Summary
-
-
-
Constructor Detail
-
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 Detail
-
empty
public static MappingMethodOptions empty()
creates empty mapping options- Returns:
- empty mapping options
-
getMappings
public Set<MappingOptions> getMappings()
- Returns:
- the
MappingOptions
s configured for this method, keyed by target property name. Only for enum mapping methods a target will be mapped by several sources.
-
getIterableMapping
public IterableMappingOptions getIterableMapping()
-
getMapMapping
public MapMappingOptions getMapMapping()
-
getBeanMapping
public BeanMappingOptions getBeanMapping()
-
getEnumMappingOptions
public EnumMappingOptions getEnumMappingOptions()
-
getValueMappings
public List<ValueMappingOptions> getValueMappings()
-
getSubclassMappings
public Set<SubclassMappingOptions> getSubclassMappings()
-
setIterableMapping
public void setIterableMapping(IterableMappingOptions iterableMapping)
-
setMapMapping
public void setMapMapping(MapMappingOptions mapMapping)
-
setBeanMapping
public void setBeanMapping(BeanMappingOptions beanMapping)
-
setEnumMappingOptions
public void setEnumMappingOptions(EnumMappingOptions enumMappingOptions)
-
setValueMappings
public void setValueMappings(List<ValueMappingOptions> valueMappings)
-
getMapper
public MapperOptions 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 benull
isInverse
- 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
public static MappingMethodOptions getForgedMethodInheritedOptions(MappingMethodOptions options)
SubclassMappingOptions are not inherited to forged methods. They would result in an infinite loop if they were.- Returns:
- a MappingMethodOptions without SubclassMappingOptions or SubclassValidator.
-
-