KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > validator > ValidatorParser


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.validator;
8
9
10 import com.inversoft.util.typeconverter.TypeConversionException;
11 import com.inversoft.verge.mvc.MVCException;
12 import com.inversoft.verge.mvc.MVCRequest;
13 import com.inversoft.verge.util.WebBeanProperty;
14
15
16 /**
17  * <p>
18  * This interface is used to support the validation of the
19  * model objects after they have been handled by the
20  * framework.
21  * </p>
22  *
23  * @author Brian Pontarelli
24  * @since 2.0
25  * @version 2.0
26  */

27 public interface ValidatorParser {
28
29     /**
30      * Gives the validator parser and the controller implementation the chance
31      * to setup the {@link com.inversoft.verge.mvc.MVCRequest MVCRequest} objcet however they need.
32      * Usually this will be empty.
33      *
34      * @param mvcRequest The MVCRequest to setup
35      * @throws com.inversoft.verge.mvc.MVCException If there were any errors encountered
36      */

37     void preExecute(MVCRequest mvcRequest) throws MVCException;
38
39     /**
40      * Handles the parsing and execution of the validators.
41      *
42      * @param mvcRequest The MVCRequest if needed
43      */

44     void execute(MVCRequest mvcRequest) throws MVCException;
45
46     /**
47      * Handles the parsing and execution of the validators when a conversion
48      * exception is encountered. This allows the model to easily handle the
49      * exception by delegating to this class. The method agrees that if it can
50      * not handle the type conversion exception, it will wrap and re-throw it.
51      *
52      * @param mvcRequest The MVCRequest if needed
53      * @param tce The TypeConversionException that was thrown
54      * @param model The Model object that the conversion failed for
55      * @param wbp The WebBeanProperty that describes the property that failed
56      * during the conversion
57      */

58     void executeHandle(MVCRequest mvcRequest, TypeConversionException tce,
59             Object JavaDoc model, WebBeanProperty wbp)
60     throws MVCException;
61 }
Popular Tags