KickJava   Java API By Example, From Geeks To Geeks.

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


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 import com.inversoft.util.typeconverter.TypeConversionException;
10 import com.inversoft.verge.mvc.MVCException;
11 import com.inversoft.verge.mvc.MVCRequest;
12 import com.inversoft.verge.util.WebBeanProperty;
13
14 /**
15  * <p>
16  * This is the handler interface that can be implemented to
17  * provide validator functionality for a specific MVC system.
18  * </p>
19  *
20  * @author Brian Pontarelli
21  */

22 public interface ValidatorHandler {
23
24     /**
25      * Does the validation of any model objects in an implementation dependent
26      * manner.
27      *
28      * @param mvcRequest The MVCRequest object if needed
29      * @return True if the validation was successfull, false otherwise
30      * @throws com.inversoft.verge.mvc.MVCException If anything went wrong during validation
31      */

32     boolean validate(MVCRequest mvcRequest) throws MVCException;
33
34     /**
35      * Does the type conversion handling for any model objects in an implementation
36      * dependent manner.
37      *
38      * @param mvcRequest The MVCRequest object if needed
39      * @param tce The TypeConversionException that was caught from the beans
40      * package
41      * @param model The model Object that was being populated when the exception
42      * was caught
43      * @param wbp The WebBeanProperty that describes the property that threw
44      * the exception
45      * @throws com.inversoft.verge.mvc.MVCException If anything went wrong during validation
46      */

47     void handle(MVCRequest mvcRequest, TypeConversionException tce, Object JavaDoc model,
48         WebBeanProperty wbp) throws MVCException;
49 }
Popular Tags