1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.exorcist.multi;
17
18 import java.util.Iterator;
19 import java.util.List;
20
21 import net.sf.exorcist.api.ContentException;
22 import net.sf.exorcist.api.ContentImporter;
23 import net.sf.exorcist.api.ContentState;
24
25 /***
26 * Importer plugin that passes the content state to multiple
27 * importer components.
28 */
29 public class MultiImporter implements ContentImporter {
30
31 /*** List of importer components. */
32 private List importers;
33
34 /***
35 * Sets the list of importer components.
36 *
37 * @param importers importer components
38 */
39 public void setImporters(List importers) {
40 this.importers = importers;
41 }
42
43 /*** {@inheritDoc} */
44 public void importContent(ContentState state) throws ContentException {
45 Iterator iterator = importers.iterator();
46 while (iterator.hasNext()) {
47 ContentImporter importer = (ContentImporter) iterator.next();
48 importer.importContent(state);
49 }
50 }
51
52 }