org.springframework.binding.validation.support
Class CompositeRichValidator

java.lang.Object
  extended by org.springframework.binding.validation.support.CompositeRichValidator
All Implemented Interfaces:
RichValidator, Validator

public class CompositeRichValidator
extends Object
implements RichValidator

This RichValidator allows combining several RichValidators. Eg when using a validator for Hibernate (validation available on persistent object through annotations), you might want to add a RulesValidator for more specific rules or just to expand its features.

Author:
Jan Hoskens

Constructor Summary
CompositeRichValidator(RichValidator[] validators)
          Create a CompositeRichValidator that combines all the results from the given validators.
CompositeRichValidator(RichValidator validator1, RichValidator validator2)
          Convenient creation of CompositeRichValidator using two validators.
 
Method Summary
 ValidationResults validate(Object object)
          Validates the provided object.
 ValidationResults validate(Object object, String property)
          Validates the given property of the provided object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeRichValidator

public CompositeRichValidator(RichValidator validator1,
                              RichValidator validator2)
Convenient creation of CompositeRichValidator using two validators.


CompositeRichValidator

public CompositeRichValidator(RichValidator[] validators)
Create a CompositeRichValidator that combines all the results from the given validators.

Method Detail

validate

public ValidationResults validate(Object object,
                                  String property)
Description copied from interface: RichValidator
Validates the given property of the provided object.

Specified by:
validate in interface RichValidator
Parameters:
object - the object to validate (may be an implementation of
property - the name of the only property that has changed since the last call to validate.
Returns:
the results on the validation

validate

public ValidationResults validate(Object object)
Description copied from interface: Validator
Validates the provided object.

Specified by:
validate in interface Validator
Parameters:
object - the object to validate
Returns:
the results on the validation


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.