org.iscreen.impl
Class ValidationServiceGroup

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

public class ValidationServiceGroup
extends java.lang.Object
implements ValidationService

Implementation of the ValidationService in which the service may contain zero or more validation services. Effectively, this implementation treats a set of validation services as a group and executes all of them when validate() is called (or related methods).

Note that if this service contains zero actual validation services, nothing is validated.

Author:
Shellman, Dan

Constructor Summary
ValidationServiceGroup(ValidationFactory factory, java.util.Set serviceSet)
          Constructs a group of validation services.
 
Method Summary
 DocumentationIterator getDocumentation()
          Retrieves an iterator of String values representing the documentation configured for this validation service (the underlying validation set).
 java.lang.String getServiceName()
          Returns null.
 void validate(java.lang.Object obj)
          Called to validate an object (typically a JavaBean).
 void validate(java.lang.Object obj, java.util.Locale locale)
          Called to validate an object (typically a JavaBean).
 void validateObject(java.lang.Object obj)
          Identical to validate() except that it throws the unchecked exception ObjectValidationException instead of a checked exception.
 void validateObject(java.lang.Object obj, java.util.Locale locale)
          Identical to validate() except that it throws the unchecked exception ObjectValidationException instead of a checked exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationServiceGroup

public ValidationServiceGroup(ValidationFactory factory,
                              java.util.Set serviceSet)
Constructs a group of validation services.

Parameters:
factory - The factory to retrieve the validation services from.
serviceSet - The set of validation service id's.
Method Detail

validate

public void validate(java.lang.Object obj)
              throws ValidationException
Description copied from interface: ValidationService
Called to validate an object (typically a JavaBean). If the object passes validation, nothing occurs (there should be no side-effects). If one or more Validators find one or more validation failures, then an exception will be thrown containing all validations failures found.

Specified by:
validate in interface ValidationService
Parameters:
obj - The object (usually a JavaBean) to validate.
Throws:
ValidationException - The exception containing any validation failures.

validate

public void validate(java.lang.Object obj,
                     java.util.Locale locale)
              throws ValidationException
Description copied from interface: ValidationService
Called to validate an object (typically a JavaBean). If the object passes validation, nothing occurs (there should be no side-effects). If one or more Validators find one or more validation failures, then an exception will be thrown containing all validations failures found.

Specified by:
validate in interface ValidationService
Parameters:
obj - The object (usually a JavaBean) to validate.
locale - The locale used for failure message generation.
Throws:
ValidationException - The exception containing any validation failures.

validateObject

public void validateObject(java.lang.Object obj)
Description copied from interface: ValidationService
Identical to validate() except that it throws the unchecked exception ObjectValidationException instead of a checked exception.

Specified by:
validateObject in interface ValidationService
Parameters:
obj - The object (usually a JavaBean) to validate.

validateObject

public void validateObject(java.lang.Object obj,
                           java.util.Locale locale)
Description copied from interface: ValidationService
Identical to validate() except that it throws the unchecked exception ObjectValidationException instead of a checked exception.

Specified by:
validateObject in interface ValidationService
Parameters:
obj - The object (usually a JavaBean) to validate.
locale - The locale used for failure message generation.

getServiceName

public java.lang.String getServiceName()
Returns null. Since this service may contain many services, no one name would work, so null is returned.

Specified by:
getServiceName in interface ValidationService
Returns:
Returns null.

getDocumentation

public DocumentationIterator getDocumentation()
Retrieves an iterator of String values representing the documentation configured for this validation service (the underlying validation set).

Specified by:
getDocumentation in interface ValidationService
Returns:
Returns an iterator of Strings representing documentation.