Class MCRCategoryMerger

java.lang.Object
org.mycore.mods.merger.MCRMerger
org.mycore.mods.merger.MCRCategoryMerger

public class MCRCategoryMerger extends MCRMerger
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
  • Constructor Details

    • MCRCategoryMerger

      public MCRCategoryMerger()
  • Method Details

    • isProbablySameAs

      public boolean isProbablySameAs(MCRMerger other)
      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 class MCRMerger
    • mergeFrom

      public void mergeFrom(MCRMerger other)
      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.
      Overrides:
      mergeFrom in class MCRMerger