nl.openedge.baritus
Class ValidatorRegistry

java.lang.Object
  extended bynl.openedge.baritus.ValidatorRegistry

public final class ValidatorRegistry
extends java.lang.Object

Registry for populators. Each instance of FormBeanBase has its own instance.

Author:
Eelco Hillenius

Constructor Summary
ValidatorRegistry()
           
 
Method Summary
 void addValidationActivationRule(ValidationActivationRule rule)
          register the rule for the whole form
 void addValidator(FormValidator validator)
          register a form validator.
 void addValidator(java.lang.String fieldName, FieldValidator validator)
          register a field validator for the given fieldName.
 MultiHashMap getFieldValidators()
          get all field validators
 java.util.List getFormValidators()
          get all form validators
 java.util.List getGlobalValidatorActivationRules()
          get all global activation rules
 MultiHashMap getValidators(java.lang.String fieldName)
          get the fieldValidators that were registered with the given fieldName
 void removeValidationActivationRule(ValidationActivationRule rule)
          de-register the given rule for the whole form
 void removeValidator(FormValidator validator)
          de-register the given form level validator
 void removeValidator(java.lang.String fieldName, FieldValidator validator)
          de-register the given validator that was registered with the given fieldName
 void removeValidators(java.lang.String fieldName)
          de-register the fieldValidators that were registered with the given fieldName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorRegistry

public ValidatorRegistry()
Method Detail

addValidator

public void addValidator(java.lang.String fieldName,
                         FieldValidator validator)
register a field validator for the given fieldName. multiple fieldValidators for one key are allowed.

Parameters:
fieldName - name of field
validator - validator instance

addValidator

public void addValidator(FormValidator validator)
register a form validator.

Parameters:
validator - the form level validator

removeValidators

public void removeValidators(java.lang.String fieldName)
de-register the fieldValidators that were registered with the given fieldName

Parameters:
fieldName - name of field

removeValidator

public void removeValidator(java.lang.String fieldName,
                            FieldValidator validator)
de-register the given validator that was registered with the given fieldName

Parameters:
fieldName - name of field
validator - the validator to remove for the given field

removeValidator

public void removeValidator(FormValidator validator)
de-register the given form level validator

Parameters:
validator - form validator

addValidationActivationRule

public void addValidationActivationRule(ValidationActivationRule rule)
register the rule for the whole form

Parameters:
rule - validator activation rule

removeValidationActivationRule

public void removeValidationActivationRule(ValidationActivationRule rule)
de-register the given rule for the whole form

Parameters:
rule - validator activation rule

getValidators

public MultiHashMap getValidators(java.lang.String fieldName)
get the fieldValidators that were registered with the given fieldName

Parameters:
fieldName - name of the field
Returns:
FieldValidator the instance of FieldValidator that was registered with the given fieldName or null if none was registered with that name

getGlobalValidatorActivationRules

public java.util.List getGlobalValidatorActivationRules()
get all global activation rules

Returns:
List all global activation rules

getFormValidators

public java.util.List getFormValidators()
get all form validators

Returns:
List all form validators

getFieldValidators

public MultiHashMap getFieldValidators()
get all field validators

Returns:
get all field validators


Copyright © 2003-2004 Open Edge. All Rights Reserved.