org.apache.wicket.validation
Class CompoundValidator<T>

java.lang.Object
  extended by org.apache.wicket.validation.CompoundValidator<T>
Type Parameters:
T - type of validatable
All Implemented Interfaces:
Serializable, IClusterable, IValidator<T>

public class CompoundValidator<T>
extends Object
implements IValidator<T>

A compound IValidator. Once an error is reported against the IValidatable being checked, the rest of the validator chain is ignored.

Since:
1.2.6
Author:
Igor Vaynberg (ivaynberg)
See Also:
Serialized Form

Constructor Summary
CompoundValidator()
          Constructor.
 
Method Summary
 CompoundValidator<T> add(IValidator<T> validator)
          Adds an IValidator to the chain of validators.
 List<IValidator<T>> getValidators()
          Gets an unmodifiable list of the registered validators.
 void validate(IValidatable<T> validatable)
          Validates the IValidatable instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundValidator

public CompoundValidator()
Constructor.

Method Detail

add

public final CompoundValidator<T> add(IValidator<T> validator)
Adds an IValidator to the chain of validators.

Parameters:
validator - an IValidator to be added
Returns:
this ValidationError for chaining purposes

validate

public final void validate(IValidatable<T> validatable)
Description copied from interface: IValidator
Validates the IValidatable instance. Validation errors should be reported using the IValidatable.error(IValidationError) method.

Specified by:
validate in interface IValidator<T>
Parameters:
validatable - the IValidatable instance being validated
See Also:
IValidator.validate(IValidatable)

getValidators

public final List<IValidator<T>> getValidators()
Gets an unmodifiable list of the registered validators.

Returns:
unmodifiable list of delegate IValidators inside this one


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.