1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package eteg.sinon.listener;
24
25 import eteg.sinon.core.Catalog;
26 import eteg.sinon.core.Collector;
27 import eteg.sinon.core.Page;
28 import eteg.sinon.core.Prompt;
29 import eteg.sinon.executor.CollectorExecutor;
30
31 import java.util.Properties;
32
33 /***
34 * Interface implemented by classes that handle collectors that need
35 * some interaction with the user in order to obtain necessary information.
36 * Implementations of this interface must have a public, static method
37 * named <code>getInstance</code> that returns an instance of the class.
38 * <b>{@link CollectorExecutor} does not have {@link PromptListener} support
39 * yet</b>.
40 *
41 * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
42 * @author Last modified by $Author: thiagohp $
43 * @version $Revision: 1.2 $
44 */
45 public interface PromptListener {
46
47 /***
48 * Handles an interaction with an user. The results must be returned as
49 * a <code>Properties</code> containing <code>name=value</code> values
50 * that will be put in the collector context.
51 *
52 * @param prompt a {@link Prompt} instance containing info
53 * about the interaction request.
54 * @param executor the {@link eteg.sinon.executor.CollectorExecutor}
55 * being executed.
56 * @param catalog the {@link Catalog} being executed.
57 * @param page the {@link Page} being executed.
58 * @return a <code>Properties</code> instance.
59 */
60 public Properties onPrompt(Prompt prompt,
61 CollectorExecutor executor,
62 Catalog catalog,
63 Page page);
64
65 }