View Javadoc

1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/listener/PromptListener.java,v 1.2 2005/06/21 14:25:08 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:08 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
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  }