Class DefaultXmlMerge

java.lang.Object
ch.galinet.xml.xmlmerge.merge.DefaultXmlMerge
All Implemented Interfaces:
XmlMerge

public class DefaultXmlMerge extends Object implements XmlMerge
Default implementation of XmlMerge. Create all JDOM documents, then perform the merge into a new JDOM document.
Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
  • Constructor Details

    • DefaultXmlMerge

      public DefaultXmlMerge()
      Creates a new DefaultXmlMerge instance.
  • Method Details

    • setRootMapper

      public void setRootMapper(Mapper rootMapper)
      Sets the Mapper which will be applied to the root element.
      Specified by:
      setRootMapper in interface XmlMerge
      Parameters:
      rootMapper - The Mapper which will be applied to the root element
    • setRootMergeAction

      public void setRootMergeAction(MergeAction rootMergeAction)
      Sets the MergeAction which will be applied to the root element.
      Specified by:
      setRootMergeAction in interface XmlMerge
      Parameters:
      rootMergeAction - The MergeAction which will be applied to the root element
    • merge

      public String merge(String[] sources) throws AbstractXmlMergeException
      Merges the given String sources.
      Specified by:
      merge in interface XmlMerge
      Parameters:
      sources - Array of String sources to merge
      Returns:
      String corresponding to the merged sources
      Throws:
      AbstractXmlMergeException - If an error occurred during the merge
    • merge

      public Document merge(Document[] sources) throws AbstractXmlMergeException
      Merges the given Document sources.
      Specified by:
      merge in interface XmlMerge
      Parameters:
      sources - Array of Document sources to merge
      Returns:
      Document corresponding to the merged sources
      Throws:
      AbstractXmlMergeException - If an error occurred during the merge
    • merge

      public InputStream merge(InputStream[] sources) throws AbstractXmlMergeException
      Merges the given InputStream sources.
      Specified by:
      merge in interface XmlMerge
      Parameters:
      sources - Array of InputStream sources to merge
      Returns:
      InputStream corresponding to the merged sources
      Throws:
      AbstractXmlMergeException - If an error occurred during the merge