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.xml.dom;
23
24 import java.io.IOException;
25
26 import org.dom4j.Element;
27
28 import de.fu_berlin.ties.ContextMap;
29 import de.fu_berlin.ties.ProcessingException;
30
31 import de.fu_berlin.ties.text.TokenContainer;
32
33 /***
34 * Interface for a processor that operates on elements in XML documents.
35 *
36 * @author Christian Siefkes
37 * @version $Revision: 1.2 $, $Date: 2004/02/05 14:23:57 $, $Author: siefkes $
38 */
39 public interface ElementProcessor {
40
41 /***
42 * Processes an element in an XML document, optionally modifying the
43 * element or the document it is part of.
44 *
45 * @param element the element to process
46 * @param tokenContainer a container storing all tokens seen in the
47 * document so far; {@link TokenContainer#getLast()} contains the textual
48 * content of the element and its child elements
49 * @param context a map of objects that are made available for processing
50 * @throws IOException if an I/O error occurs
51 * @throws ProcessingException if an error occurs during processing
52 */
53 void processElement(final Element element,
54 final TokenContainer tokenContainer, final ContextMap context)
55 throws IOException, ProcessingException;
56
57 }