KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > swing > data > Validator


1 /*
2  * $Id: Validator.java,v 1.1.1.1 2004/06/16 01:43:39 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.swing.data;
9
10 import java.util.Locale JavaDoc;
11
12 /**
13  * Interface for defining an object which performs validation checks
14  * on a value object to determine whether or not it is valid.
15  *
16  * @author Amy Fowler
17  * @version 1.0
18  */

19 public interface Validator {
20     /**@todo aim: change String array to StringBuffer */
21     /**
22      * Determines whether or not the specified value is valid. If
23      * validation passes, returns <code>true</code>. If
24      * validation fails, returns <code>false</code> and an
25      * appropriate localized error message will be placed in the
26      * first index of the error String array.
27      *
28      * @param value the value to be validated
29      * @param locale Locale object which should be used to encode any
30      * returned error messages
31      * @param error String array used to return an error message if
32      * validation fails
33      * @return boolean indicating whether or not the specified object
34      * is valid
35      */

36     boolean validate(Object JavaDoc value, Locale JavaDoc locale, String JavaDoc[] error);
37
38 }
39
Popular Tags