Class ConfigurableXmlMerge

java.lang.Object
ch.galinet.xml.xmlmerge.config.ConfigurableXmlMerge
All Implemented Interfaces:
XmlMerge

public class ConfigurableXmlMerge extends Object implements XmlMerge
XmlMerge wrapper applying a configurer on the wrapped instance.
Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
  • Constructor Details

    • ConfigurableXmlMerge

      public ConfigurableXmlMerge(Configurer configurer) throws ConfigurationException
      Creates a default XmlMerge instance and configures it with the given configurer.
      Parameters:
      configurer - The configurer used to configure the XmlMerge instance
      Throws:
      ConfigurationException - If an error occurred during configuration
    • ConfigurableXmlMerge

      public ConfigurableXmlMerge(XmlMerge wrappedXmlMerge, Configurer configurer) throws ConfigurationException
      Applies a configurer on a wrapped XmlMerge instance.
      Parameters:
      wrappedXmlMerge - The wrapped XmlMerge instance to configure
      configurer - The configurer to apply
      Throws:
      ConfigurationException - If an error occurred during configuration
  • Method Details

    • 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
    • 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 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
    • 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