Class MCRIdentifierMerger

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

public class MCRIdentifierMerger extends MCRMerger
Compares and merges mods:identifier elements. Two identifiers are assumed to be the same when they are equals, neglecting any hyphens. At merge, the identifier containing hyphens wins, because it is regarded prettier ;-)
Author:
Frank Lützenkirchen
  • Constructor Details

    • MCRIdentifierMerger

      public MCRIdentifierMerger()
  • Method Details

    • setElement

      public void setElement(Element element)
      Description copied from class: MCRMerger
      Sets the MODS element wrapped and compared by this merger
      Overrides:
      setElement in class MCRMerger
    • 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