Package org.cadixdev.lorenz.impl.merge
Class MappingSetMergerImpl
- java.lang.Object
-
- org.cadixdev.lorenz.impl.merge.MappingSetMergerImpl
-
- All Implemented Interfaces:
MappingSetMerger
public class MappingSetMergerImpl extends java.lang.Object implements MappingSetMerger
Default implementation ofMappingSetMerger.
-
-
Constructor Summary
Constructors Constructor Description MappingSetMergerImpl(MappingSet left, MappingSet right, MergeConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MappingSetmerge(MappingSet target)Merge the twoMappingSets in this merger together into the providedtarget.protected <T extends ClassMapping<T,?>>
voidmergeClass(T left, T right, T newMapping)FieldMappingmergeField(FieldMapping left, FieldMapping right, ClassMapping<?,?> target)Merge the two providedFieldMappings together into the providedtarget.protected FieldMappingmergeFieldInternal(FieldMapping left, FieldMapping strictRightContinuation, FieldMapping looseRightContinuation, FieldMapping strictRightDuplicate, FieldMapping looseRightDuplicate, ClassMapping<?,?> target)InnerClassMappingmergeInnerClass(InnerClassMapping left, InnerClassMapping right, ClassMapping<?,?> target)Merge the members of the two providedInnerClassMappings together into the providedtarget.protected InnerClassMappingmergeInnerClassInternal(InnerClassMapping left, InnerClassMapping rightContinuation, InnerClassMapping rightDuplicate, ClassMapping<?,?> target)MethodMappingmergeMethod(MethodMapping left, MethodMapping right, ClassMapping<?,?> target)Merge the two providedMethodMappings together into the providedtarget.protected MethodMappingmergeMethodInternal(MethodMapping left, MethodMapping strictRightContinuation, MethodMapping looseRightContinuation, MethodMapping strictRightDuplicate, MethodMapping looseRightDuplicate, ClassMapping<?,?> target)protected voidmergeMethodInto(MethodMapping left, MethodMapping right, MethodMapping newMapping)MethodParameterMappingmergeMethodParameter(MethodParameterMapping left, MethodParameterMapping right, MethodMapping target)Merge the two providedMethodParameterMappings together into the providedtarget.TopLevelClassMappingmergeTopLevelClass(TopLevelClassMapping left, TopLevelClassMapping right, MappingSet target)Merge the members of the two providedTopLevelClassMappings together into the providedtarget.protected TopLevelClassMappingmergeTopLevelClassInternal(TopLevelClassMapping left, TopLevelClassMapping rightContinuation, TopLevelClassMapping rightDuplicate, MappingSet target)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cadixdev.lorenz.merge.MappingSetMerger
merge
-
-
-
-
Constructor Detail
-
MappingSetMergerImpl
public MappingSetMergerImpl(MappingSet left, MappingSet right, MergeConfig config)
-
-
Method Detail
-
merge
public MappingSet merge(MappingSet target)
Description copied from interface:MappingSetMergerMerge the twoMappingSets in this merger together into the providedtarget. For ease of use the providedtargetmapping set is also returned.- Specified by:
mergein interfaceMappingSetMerger- Parameters:
target- The mapping set to insert the merged mappings into- Returns:
- The
targetparameter.
-
mergeTopLevelClass
public TopLevelClassMapping mergeTopLevelClass(TopLevelClassMapping left, TopLevelClassMapping right, MappingSet target)
Description copied from interface:MappingSetMergerMerge the members of the two providedTopLevelClassMappings together into the providedtarget.- Specified by:
mergeTopLevelClassin interfaceMappingSetMerger- Parameters:
left- The class mapping for the left side of the merge. May benull.right- The class mapping for the right side of the merge. May benull.target- The mapping set to insert the new merged mapping into. May not benull.- Returns:
- The new class mapping, or
nullif the mapping is to be removed.
-
mergeTopLevelClassInternal
protected TopLevelClassMapping mergeTopLevelClassInternal(TopLevelClassMapping left, TopLevelClassMapping rightContinuation, TopLevelClassMapping rightDuplicate, MappingSet target)
-
mergeInnerClass
public InnerClassMapping mergeInnerClass(InnerClassMapping left, InnerClassMapping right, ClassMapping<?,?> target)
Description copied from interface:MappingSetMergerMerge the members of the two providedInnerClassMappings together into the providedtarget.- Specified by:
mergeInnerClassin interfaceMappingSetMerger- Parameters:
left- The class mapping for the left side of the merge. May benull.right- The class mapping for the right side of the merge. May benull.target- The class mapping to insert the new merged mapping into. May not benull.- Returns:
- The new class mapping, or
nullif the mapping is to be removed.
-
mergeInnerClassInternal
protected InnerClassMapping mergeInnerClassInternal(InnerClassMapping left, InnerClassMapping rightContinuation, InnerClassMapping rightDuplicate, ClassMapping<?,?> target)
-
mergeField
public FieldMapping mergeField(FieldMapping left, FieldMapping right, ClassMapping<?,?> target)
Description copied from interface:MappingSetMergerMerge the two providedFieldMappings together into the providedtarget.- Specified by:
mergeFieldin interfaceMappingSetMerger- Parameters:
left- The field mapping for the left side of the merge. May benull.right- The field mapping for the right side of the merge. May benull.target- The class mapping to insert the new merged mapping into. May not benull.- Returns:
- The new field mapping, or
nullif the mapping is to be removed.
-
mergeFieldInternal
protected FieldMapping mergeFieldInternal(FieldMapping left, FieldMapping strictRightContinuation, FieldMapping looseRightContinuation, FieldMapping strictRightDuplicate, FieldMapping looseRightDuplicate, ClassMapping<?,?> target)
-
mergeMethod
public MethodMapping mergeMethod(MethodMapping left, MethodMapping right, ClassMapping<?,?> target)
Description copied from interface:MappingSetMergerMerge the two providedMethodMappings together into the providedtarget.- Specified by:
mergeMethodin interfaceMappingSetMerger- Parameters:
left- The method mapping for the left side of the merge. May benull.right- The method mapping for the right side of the merge. May benull.target- The class mapping to insert the new merged mapping into. May not benull.- Returns:
- The new method mapping, or
nullif the mapping is to be removed.
-
mergeMethodInternal
protected MethodMapping mergeMethodInternal(MethodMapping left, MethodMapping strictRightContinuation, MethodMapping looseRightContinuation, MethodMapping strictRightDuplicate, MethodMapping looseRightDuplicate, ClassMapping<?,?> target)
-
mergeMethodInto
protected void mergeMethodInto(MethodMapping left, MethodMapping right, MethodMapping newMapping)
-
mergeMethodParameter
public MethodParameterMapping mergeMethodParameter(MethodParameterMapping left, MethodParameterMapping right, MethodMapping target)
Description copied from interface:MappingSetMergerMerge the two providedMethodParameterMappings together into the providedtarget.- Specified by:
mergeMethodParameterin interfaceMappingSetMerger- Parameters:
left- The method parameter mapping for the left side of the merge. May benull.right- The method parameter mapping for the right side of the merge. May benull.target- The method mapping to insert the new merged mapping into. May not benull.- Returns:
- The new method parameter mapping, or
nullif the mapping is to be removed.
-
mergeClass
protected <T extends ClassMapping<T,?>> void mergeClass(T left, T right, T newMapping)
-
-