org.iscreen.impl
Class DefaultValidationService

java.lang.Object
  extended by org.iscreen.impl.BaseValidationService
      extended by org.iscreen.impl.DefaultValidationService
All Implemented Interfaces:
ValidationService

public class DefaultValidationService
extends BaseValidationService

This is a "default" implementation of the ValidationService interface that can be configured to act as a full implementation of the service.

Author:
Shellman, Dan

Field Summary
protected  java.util.Iterator currentIterator
           
protected  java.util.List validatorWrappers
           
 
Fields inherited from class org.iscreen.impl.BaseValidationService
defaultLocale, id
 
Constructor Summary
DefaultValidationService(java.lang.String uniqueId, java.util.Locale locale)
          Constructor requiring a unique id and default locale
 
Method Summary
 void addValidatorWrapper(ValidatorWrapper wrapper)
          Adds a validator wrapper, which is used to call the contained validator.
 java.util.List getAllWrappers()
          Retrieves all of the validator wrappers this service is configured with.
protected  ValidatorWrapper getNextValidator()
          Retrieves the "next" Validator in the set of Validators that this validation service is configured to use.
protected  void resetValidatorIteration()
          Resets the iteration of Validators using the getNextValidator() method.
 
Methods inherited from class org.iscreen.impl.BaseValidationService
constructContext, constructRoot, getServiceName, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validatorWrappers

protected java.util.List validatorWrappers

currentIterator

protected java.util.Iterator currentIterator
Constructor Detail

DefaultValidationService

public DefaultValidationService(java.lang.String uniqueId,
                                java.util.Locale locale)
Constructor requiring a unique id and default locale

Parameters:
uniqueId - The unique id of the validation service.
locale - The default locale
Method Detail

addValidatorWrapper

public void addValidatorWrapper(ValidatorWrapper wrapper)
Adds a validator wrapper, which is used to call the contained validator. The ordering of the calls to this method are retained, so that when the wrappers are iterated through, they are done in order of when this method is called.

Parameters:
wrapper - The wrapper to add to this validation service.

getAllWrappers

public java.util.List getAllWrappers()
Retrieves all of the validator wrappers this service is configured with.

Returns:
Returns the list of wrappers this service is configured with.

getNextValidator

protected ValidatorWrapper getNextValidator()
Description copied from class: BaseValidationService
Retrieves the "next" Validator in the set of Validators that this validation service is configured to use. If there are no more Validators, then this method should return null. It should return the first Validator after a call to resetValidatorIteration().

Specified by:
getNextValidator in class BaseValidationService
Returns:
Returns the next ValidatorWrapper in the set of validators.

resetValidatorIteration

protected void resetValidatorIteration()
Description copied from class: BaseValidationService
Resets the iteration of Validators using the getNextValidator() method.

Specified by:
resetValidatorIteration in class BaseValidationService