Package org.codehaus.cargo.module.merge
Class DescriptorMergerByTag
- java.lang.Object
-
- org.codehaus.cargo.module.merge.DescriptorMergerByTag
-
- All Implemented Interfaces:
DescriptorMerger
public class DescriptorMergerByTag extends Object implements DescriptorMerger
Merge a descriptor by tag.
-
-
Field Summary
Fields Modifier and Type Field Description static MergeStrategy
IGNORE
A default merge strategy for ignoring items.static MergeStrategy
OVERWRITE
A default merge strategy for overwriting items.static MergeStrategy
PRESERVE
A default merge strategy for preserving items.
-
Constructor Summary
Constructors Constructor Description DescriptorMergerByTag()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MergeStrategy
getDefaultStrategyIfNoneSpecified()
DescriptorType
getDescriptorType()
protected MergeStrategy
getMergeStrategy(String tag)
void
init(Descriptor base)
Initialize.void
merge(Descriptor other)
Merge this descriptor onto another.void
setDefaultStrategyIfNoneSpecified(MergeStrategy defaultStrategyIfNoneSpecified)
void
setDescriptorType(DescriptorType descriptorTagFactory)
void
setStrategy(String tag, MergeStrategy strategy)
Set the merging strategy for a particular tag.
-
-
-
Field Detail
-
IGNORE
public static final MergeStrategy IGNORE
A default merge strategy for ignoring items.
-
OVERWRITE
public static final MergeStrategy OVERWRITE
A default merge strategy for overwriting items.
-
PRESERVE
public static final MergeStrategy PRESERVE
A default merge strategy for preserving items.
-
-
Method Detail
-
setStrategy
public void setStrategy(String tag, MergeStrategy strategy)
Set the merging strategy for a particular tag.- Parameters:
tag
- Tag to setstrategy
- Strategy to use
-
init
public void init(Descriptor base)
Initialize.- Specified by:
init
in interfaceDescriptorMerger
- Parameters:
base
- the base for the merge.
-
merge
public void merge(Descriptor other)
Merge this descriptor onto another.- Specified by:
merge
in interfaceDescriptorMerger
- Parameters:
other
- descriptor to merge
-
getMergeStrategy
protected MergeStrategy getMergeStrategy(String tag)
- Parameters:
tag
- tag to get the merge strategy for- Returns:
- the merge strategy
-
getDefaultStrategyIfNoneSpecified
public MergeStrategy getDefaultStrategyIfNoneSpecified()
- Returns:
- the defaultStrategyIfNoneSpecified
-
setDefaultStrategyIfNoneSpecified
public void setDefaultStrategyIfNoneSpecified(MergeStrategy defaultStrategyIfNoneSpecified)
- Parameters:
defaultStrategyIfNoneSpecified
- the defaultStrategyIfNoneSpecified to set
-
getDescriptorType
public DescriptorType getDescriptorType()
- Returns:
- the descriptorTagFactory
-
setDescriptorType
public void setDescriptorType(DescriptorType descriptorTagFactory)
- Parameters:
descriptorTagFactory
- the descriptorTagFactory to set
-
-