1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package de.fu_berlin.ties.filter;
23
24 import java.io.File;
25 import java.io.IOException;
26
27 import org.dom4j.Document;
28
29 import de.fu_berlin.ties.ProcessingException;
30
31 /***
32 * An interface for classes that rewrite documents, for example for adding
33 * semantic information. Document rewriters <strong>must not</strong> modify
34 * the textual content of a document, they may only modify XML elements and
35 * attributes.
36 *
37 * @author Christian Siefkes
38 * @version $Revision: 1.3 $, $Date: 2006/10/21 16:04:19 $, $Author: siefkes $
39 */
40 public interface DocumentRewriter {
41
42 /***
43 * Rewrites a document.
44 *
45 * @param doc the document to modify
46 * @param filename the name of the document
47 * @return the modified document; this object may or may not be identical
48 * to the <code>document</code> passed it
49 * @throws IOException if an I/O error occurs
50 * @throws ProcessingException if an error occurs during rewriting
51 */
52 Document rewrite(final Document doc, final File filename)
53 throws IOException, ProcessingException;
54
55 }