
public class MappingOptions extends Object
| Constructor and Description |
|---|
MappingOptions(Map<String,List<Mapping>> mappings,
IterableMapping iterableMapping,
MapMapping mapMapping,
BeanMapping beanMapping,
List<ValueMapping> valueMappings,
boolean restrictToDefinedMappings) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyIgnoreAll(MappingOptions inherited,
SourceMethod method,
FormattingMessager messager,
TypeFactory typeFactory,
AccessorNamingUtils accessorNaming) |
void |
applyInheritedOptions(MappingOptions inherited,
boolean isInverse,
SourceMethod method,
FormattingMessager messager,
TypeFactory typeFactory,
AccessorNamingUtils accessorNaming)
Merges in all the mapping options configured, giving the already defined options precedence.
|
List<String> |
collectNestedDependsOn() |
static MappingOptions |
empty()
creates empty mapping options
|
static MappingOptions |
forMappingsOnly(Map<String,List<Mapping>> mappings,
boolean restrictToDefinedMappings)
creates mapping options with only regular mappings
|
static MappingOptions |
forMappingsOnly(Map<String,List<Mapping>> mappings,
boolean restrictToDefinedMappings,
boolean forForgedMethods)
creates mapping options with only regular mappings
|
BeanMapping |
getBeanMapping() |
IterableMapping |
getIterableMapping() |
MapMapping |
getMapMapping() |
Map<String,List<Mapping>> |
getMappings() |
List<ValueMapping> |
getValueMappings() |
boolean |
hasNestedTargetReferences()
Check there are nested target references for this mapping options.
|
void |
initWithParameter(Parameter sourceParameter)
Initializes the underlying mappings with a new property.
|
boolean |
isFullyInitialized() |
boolean |
isRestrictToDefinedMappings() |
void |
markAsFullyInitialized() |
void |
setBeanMapping(BeanMapping beanMapping) |
void |
setIterableMapping(IterableMapping iterableMapping) |
void |
setMapMapping(MapMapping mapMapping) |
void |
setMappings(Map<String,List<Mapping>> mappings) |
void |
setValueMappings(List<ValueMapping> valueMappings) |
public MappingOptions(Map<String,List<Mapping>> mappings, IterableMapping iterableMapping, MapMapping mapMapping, BeanMapping beanMapping, List<ValueMapping> valueMappings, boolean restrictToDefinedMappings)
public static MappingOptions empty()
public static MappingOptions forMappingsOnly(Map<String,List<Mapping>> mappings, boolean restrictToDefinedMappings)
mappings - regular mappings to addrestrictToDefinedMappings - whether to restrict the mappings only to the defined mappingspublic static MappingOptions forMappingsOnly(Map<String,List<Mapping>> mappings, boolean restrictToDefinedMappings, boolean forForgedMethods)
mappings - regular mappings to addrestrictToDefinedMappings - whether to restrict the mappings only to the defined mappingsforForgedMethods - whether the mappings are for forged methodspublic Map<String,List<Mapping>> getMappings()
Mappings configured for this method, keyed by target property name. Only for enum mapping
methods a target will be mapped by several sources. TODO. Remove the value list when 2.0public boolean hasNestedTargetReferences()
public List<String> collectNestedDependsOn()
public void initWithParameter(Parameter sourceParameter)
sourceParameter - the new source parameterpublic IterableMapping getIterableMapping()
public MapMapping getMapMapping()
public BeanMapping getBeanMapping()
public List<ValueMapping> getValueMappings()
public void setIterableMapping(IterableMapping iterableMapping)
public void setMapMapping(MapMapping mapMapping)
public void setBeanMapping(BeanMapping beanMapping)
public void setValueMappings(List<ValueMapping> valueMappings)
public boolean isFullyInitialized()
true, iff the options have been fully initialized by applying all available inheritance
optionspublic void markAsFullyInitialized()
public void applyInheritedOptions(MappingOptions inherited, boolean isInverse, SourceMethod method, FormattingMessager messager, TypeFactory typeFactory, AccessorNamingUtils accessorNaming)
inherited - the options to inherit, may be nullisInverse - if true, the specified options are from an inverse methodmethod - the source methodmessager - the messagertypeFactory - the type factoryaccessorNaming - the accessor naming utilspublic void applyIgnoreAll(MappingOptions inherited, SourceMethod method, FormattingMessager messager, TypeFactory typeFactory, AccessorNamingUtils accessorNaming)
public boolean isRestrictToDefinedMappings()
Copyright © 2012-2019 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.