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  boolean declared
           
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  java.util.Iterator getWrapperIterator()
          Retrieves an Iterator that will iterate through the ValidatorWrapper instances contained by this service.
 boolean isDeclared()
          Flag to determine if the validation set has been declared or merely referenced
 void signalDeclared()
          Sets the flag to signal that the validation set has been declared, rather than merely referenced
 
Methods inherited from class org.iscreen.impl.BaseValidationService
constructContext, constructContextBean, getDocumentation, getServiceName, validate, validate, validateObject, validateObject
 
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

declared

protected boolean declared
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.

getWrapperIterator

protected java.util.Iterator getWrapperIterator()
Description copied from class: BaseValidationService
Retrieves an Iterator that will iterate through the ValidatorWrapper instances contained by this service.

Specified by:
getWrapperIterator in class BaseValidationService
Returns:
Returns an Iterator of the contained ValidatorWrappers.

isDeclared

public boolean isDeclared()
Flag to determine if the validation set has been declared or merely referenced

Returns:
true If declared, else just referenced.

signalDeclared

public void signalDeclared()
Sets the flag to signal that the validation set has been declared, rather than merely referenced

Throws:
ConfigurationException - If a re-declaration occurs.