org.millstone.base.data
Interface Validator

All Known Subinterfaces:
Validator.Suggestive
All Known Implementing Classes:
CompositeValidator, NullValidator, StringLengthValidator

public interface Validator

Object validator interface. Implementors of this class can be added to any Validatable object to verify its value. The Validatable#isValid(Object) iterates all registered Validators, calling their validate(Object) methods. validate(Object) should throw the Validator.InvalidValueException if the given value is not valid by its standards.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
static class Validator.InvalidValueException
          Invalid value exception can be thrown by Validator when a given value is not valid.
static interface Validator.Suggestive
          Adds the proposing functionality to a Validator.
 
Method Summary
 boolean isValid(java.lang.Object value)
          Test if the the given value is valid.
 void validate(java.lang.Object value)
          Checks the given value against this validator.
 

Method Detail

validate

public void validate(java.lang.Object value)
              throws Validator.InvalidValueException
Checks the given value against this validator. If the value is valid this method should do nothing, and if it's not valid, it should throw Validator.InvalidValueException

Parameters:
value - the value to check
Throws:
Validator.InvalidValueException - if the value is not valid

isValid

public boolean isValid(java.lang.Object value)
Test if the the given value is valid.

Parameters:
value - the value to check


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.