com.cafesoft.core.data
Interface ValidatorMap

All Known Implementing Classes:
StandardValidatorMap

public interface ValidatorMap

ValidatorMap defines an interface for objects that map a key to a Validator used to validate values assigned to the key.

Since:
12/28/2006

Method Summary
 void add(String key, Validator validator)
          Add a Validator for the specified key.
 boolean containsKey(String key)
          Returns true if the ValidtorMap contains the specified key.
 void destroy()
          Destroy the ValidatorMap.
 boolean validate(String key, Object value, boolean validIfNoValidator)
          Validate the value associated with a given key.
 

Method Detail

add

void add(String key,
         Validator validator)
Add a Validator for the specified key.

Parameters:
key - the key.
validator - the Validator.

validate

boolean validate(String key,
                 Object value,
                 boolean validIfNoValidator)
Validate the value associated with a given key.

Parameters:
key - the key associated with the value to be validated.
value - the value to be validated.
validIfNoValidator - a boolean value indicating whether validation should succeed if no validator is defined for a the specified key. If true and a Validator is not associated with the key, then return true.
Returns:
true if the value is valid or false if it is not.

containsKey

boolean containsKey(String key)
Returns true if the ValidtorMap contains the specified key.

Parameters:
key - the key.
Returns:
true if the ValidatorMap contains the specified key, else false.

destroy

void destroy()
Destroy the ValidatorMap.



Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.