Package org.mycore.mods.merger
Class MCRCategoryMerger
java.lang.Object
org.mycore.mods.merger.MCRMerger
org.mycore.mods.merger.MCRCategoryMerger
Merges MODS elements that represent a classification category.
When those elements represent two categories A and B,
and B is a child of A in the classification tree,
B should win and be regarded the more detailed information,
while A should be ignored.
When property
MCR.MODS.Merger.CategoryMerger.Repeatable.[ClassID]=false
is set, there can be only one category for this classification,
so the first element that occurs wins.
Default is "true", meaning the classification is repeatable.
- Author:
- Frank Lützenkirchen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isProbablySameAs
(MCRMerger other) Returns true, if the element wrapped by this merger probably represents the same information as the other.void
Merges the contents of the element wrapped by the other merger into the contents of the element wrapped by this merger.Methods inherited from class org.mycore.mods.merger.MCRMerger
equals, getNodes, mergeAttributes, mergeElements, setElement
-
Constructor Details
-
MCRCategoryMerger
public MCRCategoryMerger()
-
-
Method Details
-
isProbablySameAs
Description copied from class:MCRMerger
Returns true, if the element wrapped by this merger probably represents the same information as the other. The default implementation returns false and may be overwritten by subclasses implementing logic for specific MODS elements.- Overrides:
isProbablySameAs
in classMCRMerger
-
mergeFrom
Description copied from class:MCRMerger
Merges the contents of the element wrapped by the other merger into the contents of the element wrapped by this merger. Should only be called if this.isProbablySameAs(other). The default implementation copies all attributes from the other into this if they do not exist in this element. Afterwards it recursively builds mergers for all child elements and compares and eventually merges them too.
-