KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > databinding > validation > IValidator


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.databinding.validation;
12
13 import org.eclipse.core.runtime.IStatus;
14
15 /**
16  * A validator. This validator is responsible for determining if a given value
17  * is valid. Validators can be used on target or model values. For example, a
18  * String2IntValidator would only accept source Strings that can successfully be
19  * converted to an integer value, and a PositiveIntegerValidator would only
20  * accept positive integers.
21  *
22  * @since 1.0
23  *
24  */

25 public interface IValidator {
26
27     /**
28      * Determines if the given value is valid.
29      *
30      * @param value
31      * the value to validate
32      * @return a status object indicating whether the validation succeeded
33      * {@link IStatus#isOK()} or not. Never null.
34      */

35     public IStatus validate(Object JavaDoc value);
36     
37 }
38
Popular Tags