/*
 * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
package com.arsdigita.bebop.event;

import java.util.EventListener;

import com.arsdigita.bebop.FormProcessException;

/**
 * The listener called just before a form starts examining a
 * submission. This listener can throw a {@link FormProcessException} to
 * indicate that any further processing of the submission should be
 * aborted. This usually leaves the corresponding {@link
 * com.arsdigita.bebop.FormData FormData} object in an undefined
 * state.
 *
 * @author David Lutterkort
 * @version $Id$
 */
public interface FormSubmissionListener extends EventListener {

    /**
     * This method gets called as soon as the <code>FormData</code> for a
     * form has been filled with the request parameters. The values in the
     * <code>FormData</code> are transformed but not validated.
     *
     * @param e the event encapsulating form data, page state and event source
     * @throws FormProcessException to signal that further processing of the
     * form should be aborted.
     */
    void submitted(FormSectionEvent e) throws FormProcessException;

}
