View Javadoc

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