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 |
applyInheritedOptions(MappingOptions inherited,
boolean isInverse,
SourceMethod method,
FormattingMessager messager,
TypeFactory typeFactory)
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()
Mapping
s 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)
inherited
- the options to inherit, may be null
isInverse
- if true
, the specified options are from an inverse methodmethod
- the source methodmessager
- the messagertypeFactory
- the type factorypublic boolean isRestrictToDefinedMappings()
Copyright © 2012-2017 Gunnar Morling; All rights reserved. Released under the Apache Software License 2.0.