Package ch.galinet.xml.xmlmerge.config
Class ConfigurableXmlMerge
java.lang.Object
ch.galinet.xml.xmlmerge.config.ConfigurableXmlMerge
- All Implemented Interfaces:
XmlMerge
XmlMerge wrapper applying a configurer on the wrapped instance.
- Author:
- Laurent Bovet (LBO), Alex Mathey (AMA)
-
Constructor Summary
ConstructorsConstructorDescriptionConfigurableXmlMerge(Configurer configurer) Creates a default XmlMerge instance and configures it with the given configurer.ConfigurableXmlMerge(XmlMerge wrappedXmlMerge, Configurer configurer) Applies a configurer on a wrapped XmlMerge instance. -
Method Summary
Modifier and TypeMethodDescriptionmerge(InputStream[] sources) Merges the given InputStream sources.Merges the given String sources.Merges the given Document sources.voidsetRootMapper(Mapper rootMapper) Sets the Mapper which will be applied to the root element.voidsetRootMergeAction(MergeAction rootMergeAction) Sets the MergeAction which will be applied to the root element.
-
Constructor Details
-
ConfigurableXmlMerge
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 configureconfigurer- The configurer to apply- Throws:
ConfigurationException- If an error occurred during configuration
-
-
Method Details
-
merge
Merges the given InputStream sources.- Specified by:
mergein interfaceXmlMerge- 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
Merges the given Document sources.- Specified by:
mergein interfaceXmlMerge- 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
Merges the given String sources.- Specified by:
mergein interfaceXmlMerge- 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
Sets the Mapper which will be applied to the root element.- Specified by:
setRootMapperin interfaceXmlMerge- Parameters:
rootMapper- The Mapper which will be applied to the root element
-
setRootMergeAction
Sets the MergeAction which will be applied to the root element.- Specified by:
setRootMergeActionin interfaceXmlMerge- Parameters:
rootMergeAction- The MergeAction which will be applied to the root element
-