1 /*
2 * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3 * the spring framework, http://el4j.sf.net
4 * Copyright (C) 2006 by ELCA Informatique SA, Av. de la Harpe 22-24,
5 * 1000 Lausanne, Switzerland, http://www.elca.ch
6 *
7 * EL4J is published under the GNU Lesser General Public License (LGPL)
8 * Version 2.1. See http://www.gnu.org/licenses/
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * For alternative licensing, please contact info@elca.ch
16 */
17 package ch.elca.el4j.services.xmlmerge;
18
19 import java.io.InputStream;
20
21 import org.w3c.dom.Document;
22
23 /**
24 * Entry point for merging XML documents.
25 *
26 * @svnLink $Revision: 3884 $;$Date: 2009-08-04 15:48:31 +0200 (Di, 04. Aug 2009) $;$Author: swismer $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/xml_merge/common/src/main/java/ch/elca/el4j/services/xmlmerge/XmlMerge.java $
27 *
28 * @author Laurent Bovet (LBO)
29 * @author Alex Mathey (AMA)
30 */
31 public interface XmlMerge {
32
33 /**
34 * Merges the given InputStream sources.
35 *
36 * @param sources
37 * Array of InputStream sources to merge
38 * @return InputStream corresponding to the merged sources
39 * @throws AbstractXmlMergeException
40 * If an error occurred during the merge
41 */
42 public InputStream merge(InputStream[] sources)
43 throws AbstractXmlMergeException;
44
45 /**
46 * Merges the given Document sources.
47 *
48 * @param sources
49 * Array of Document sources to merge
50 * @return Document corresponding to the merged sources
51 * @throws AbstractXmlMergeException
52 * If an error occurred during the merge
53 */
54 public Document merge(Document[] sources) throws AbstractXmlMergeException;
55
56 /**
57 * Merges the given String sources.
58 *
59 * @param sources
60 * Array of String sources to merge
61 * @return String corresponding to the merged sources
62 * @throws AbstractXmlMergeException
63 * If an error occurred during the merge
64 */
65 public String merge(String[] sources) throws AbstractXmlMergeException;
66
67 /**
68 * Sets the MergeAction which will be applied to the root element.
69 *
70 * @param rootMergeAction
71 * The MergeAction which will be applied to the root element
72 */
73 public void setRootMergeAction(MergeAction rootMergeAction);
74
75 /**
76 * Sets the Mapper which will be applied to the root element.
77 *
78 * @param rootMapper
79 * The Mapper which will be applied to the root element
80 */
81 public void setRootMapper(Mapper rootMapper);
82
83 }