summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/ParameterHandler.java
blob: ef8a952e0e34dae4a06de52129ddf907d20be9e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* 
@VaadinApache2LicenseForJavaFiles@
 */

package com.vaadin.terminal;

import java.io.Serializable;
import java.util.Map;

import com.vaadin.ui.Window;

/**
 * {@code ParameterHandler} is implemented by classes capable of handling
 * external parameters.
 * 
 * <p>
 * What parameters are provided depend on what the {@link Terminal} provides and
 * if the application is deployed as a servlet or portlet. URL GET parameters
 * are typically provided to the {@link #handleParameters(Map)} method.
 * </p>
 * <p>
 * A {@code ParameterHandler} must be registered to a {@code Window} using
 * {@link Window#addParameterHandler(ParameterHandler)} to be called when
 * parameters are available.
 * </p>
 * 
 * @author Vaadin Ltd.
 * @version
 * @VERSION@
 * @since 3.0
 */
public interface ParameterHandler extends Serializable {

    /**
     * Handles the given parameters. All parameters names are of type
     * {@link String} and the values are {@link String} arrays.
     * 
     * @param parameters
     *            an unmodifiable map which contains the parameter names and
     *            values
     * 
     */
    public void handleParameters(Map<String, String[]> parameters);

    /**
     * An ErrorEvent implementation for ParameterHandler.
     */
    public interface ErrorEvent extends Terminal.ErrorEvent {

        /**
         * Gets the ParameterHandler that caused the error.
         * 
         * @return the ParameterHandler that caused the error
         */
        public ParameterHandler getParameterHandler();

    }

}