org.sovt.impl
Class GroupValidator

java.lang.Object
  extended byorg.sovt.impl.AbstractValidator
      extended byorg.sovt.impl.GroupValidator
All Implemented Interfaces:
java.lang.Cloneable, Validator

public final class GroupValidator
extends AbstractValidator
implements java.lang.Cloneable

This Validator is used to collect other validators into group.

Author:
Vilmantas Baranauskas (vilmantas_baranauskas@yahoo.com)

Constructor Summary
GroupValidator()
          Creates instance of GroupValidator.
 
Method Summary
 void addValidator(Validator validator)
          Adds validator to the group.
 java.lang.Object clone()
          Performs a partly deep-cloning.
 void validate(java.lang.Object object, ValidationResult result)
          Validates object by invoking all validators on it.
 
Methods inherited from class org.sovt.impl.AbstractValidator
getMessage, setMessage, setMsg
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupValidator

public GroupValidator()
Creates instance of GroupValidator.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Performs a partly deep-cloning. New list of contained validators is created but validators themselfs are not cloned.

Specified by:
clone in interface Validator
Overrides:
clone in class AbstractValidator
Returns:
clone of itself.
Throws:
java.lang.CloneNotSupportedException - never.

addValidator

public void addValidator(Validator validator)
Adds validator to the group.

Parameters:
validator - Validator to add.

validate

public void validate(java.lang.Object object,
                     ValidationResult result)
Validates object by invoking all validators on it.

Specified by:
validate in interface Validator
Parameters:
object - Object to validate
result - Container for validation results.


Copyright © 2003-2005 . All Rights Reserved.