Class MappingOptions
- java.lang.Object
-
- org.mapstruct.ap.internal.model.source.DelegatingOptions
-
- org.mapstruct.ap.internal.model.source.MappingOptions
-
public class MappingOptions extends DelegatingOptions
Represents a property mapping as configured via@Mapping
(no intermediate state).- Author:
- Gunnar Morling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MappingOptions.InheritContext
-
Method Summary
-
Methods inherited from class org.mapstruct.ap.internal.model.source.DelegatingOptions
componentModel, getBuilder, getCollectionMappingStrategy, getInjectionStrategy, getMappingInheritanceStrategy, getNullValueIterableMappingStrategy, getNullValueMapMappingStrategy, getNullValueMappingStrategy, getSubclassExhaustiveStrategy, getUnexpectedValueMappingException, implementationName, implementationPackage, imports, isDisableSubMappingMethodsGeneration, suppressTimestampInGenerated, toDeclaredTypes, typeConversionPolicy, unmappedSourcePolicy, unmappedTargetPolicy, uses
-
-
-
-
Method Detail
-
getMappingTargetNamesBy
public static Set<String> getMappingTargetNamesBy(Predicate<MappingOptions> predicate, Set<MappingOptions> mappings)
-
addInstances
public static void addInstances(org.mapstruct.ap.internal.gem.MappingsGem gem, ExecutableElement method, BeanMappingOptions beanMappingOptions, FormattingMessager messager, TypeUtils typeUtils, Set<MappingOptions> mappings)
-
addInstance
public static void addInstance(org.mapstruct.ap.internal.gem.MappingGem mapping, ExecutableElement method, BeanMappingOptions beanMappingOptions, FormattingMessager messager, TypeUtils typeUtils, Set<MappingOptions> mappings)
-
forIgnore
public static MappingOptions forIgnore(String targetName)
-
getTargetName
public String getTargetName()
-
getTargetAnnotationValue
public AnnotationValue getTargetAnnotationValue()
-
getSourceName
public String getSourceName()
Returns the complete source name of this mapping, either a qualified (e.g.parameter1.foo
) or unqualified (e.g.foo
) property reference.- Returns:
- The complete source name of this mapping.
-
getSourceAnnotationValue
public AnnotationValue getSourceAnnotationValue()
-
getConstant
public String getConstant()
-
getJavaExpression
public String getJavaExpression()
-
getDefaultJavaExpression
public String getDefaultJavaExpression()
-
getConditionJavaExpression
public String getConditionJavaExpression()
-
getDefaultValue
public String getDefaultValue()
-
getFormattingParameters
public FormattingParameters getFormattingParameters()
-
getSelectionParameters
public SelectionParameters getSelectionParameters()
-
isIgnored
public boolean isIgnored()
-
getMirror
public AnnotationMirror getMirror()
-
getElement
public Element getElement()
-
getDependsOnAnnotationValue
public AnnotationValue getDependsOnAnnotationValue()
-
getInheritContext
public MappingOptions.InheritContext getInheritContext()
-
getNullValueCheckStrategy
public org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem getNullValueCheckStrategy()
- Overrides:
getNullValueCheckStrategy
in classDelegatingOptions
-
getNullValuePropertyMappingStrategy
public org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem getNullValuePropertyMappingStrategy()
- Overrides:
getNullValuePropertyMappingStrategy
in classDelegatingOptions
-
getMappingControl
public MappingControl getMappingControl(ElementUtils elementUtils)
- Overrides:
getMappingControl
in classDelegatingOptions
-
canInverse
public boolean canInverse()
mapping can only be inversed if the source was not a constant nor an expression nor a nested property and the mapping is not a 'target-source-ignore' mapping- Returns:
- true when the above applies
-
copyForInverseInheritance
public MappingOptions copyForInverseInheritance(SourceMethod templateMethod, BeanMappingOptions beanMappingOptions)
-
copyForForwardInheritance
public MappingOptions copyForForwardInheritance(SourceMethod templateMethod, BeanMappingOptions beanMappingOptions)
Creates a copy of this mapping- Parameters:
templateMethod
- the template method for the inheritancebeanMappingOptions
- the bean mapping options- Returns:
- the copy
-
hasAnnotation
public boolean hasAnnotation()
- Specified by:
hasAnnotation
in classDelegatingOptions
-
-