1 package eu.ehri.project.exporters.xml;
2
3 import eu.ehri.project.models.base.Entity;
4 import org.w3c.dom.Document;
5
6 import javax.xml.transform.TransformerException;
7 import java.io.IOException;
8 import java.io.OutputStream;
9
10
11 public interface XmlExporter<T extends Entity> {
12 /**
13 * Export an item as an XML document.
14 *
15 * @param item the item
16 * @param outputStream the output stream to write to.
17 * @param langCode the preferred language code when multiple
18 * descriptions are available
19 */
20 void export(T item, OutputStream outputStream, String langCode)
21 throws IOException, TransformerException;
22
23 /**
24 * Export an item as an XML document.
25 *
26 * @param item the item
27 * @param langCode the preferred language code when multiple
28 * descriptions are available
29 * @return a DOM document
30 */
31 Document export(T item, String langCode) throws IOException;
32 }