it.amattioli.dominate.validation
Class ChainedValidator

Show UML class diagram
java.lang.Object
  extended by it.amattioli.dominate.validation.ChainedValidator
All Implemented Interfaces:
Validator
Direct Known Subclasses:
DefaultValidator, HibernateValidator3Validator

public abstract class ChainedValidator
extends Object
implements Validator


Constructor Summary
ChainedValidator()
           
ChainedValidator(Object validatingBean)
           
ChainedValidator(Object validatingBean, Validator nextInChain)
           
 
Method Summary
protected  Validator getNextInChain()
           
 Constraint getPropertyConstraint(String propertyName, String constraintName)
          Retrieves validation meta-data about a property.
 Collection<Constraint> getPropertyConstraints(String propertyName)
          Retrieves validation meta-data about a property.
protected  Object getValidatingBean()
           
protected abstract  Collection<Constraint> itselfGetPropertyConstraints(String propertyName)
           
protected abstract  ValidationResult itselfValidateBean()
           
protected abstract  ValidationResult itselfValidateProperty(String propertyName, Object value)
           
 ValidationResult validateBean()
          Check if an object is valid as a whole.
 ValidationResult validateProperty(String propertyName, Object value)
          Check if a value is valid for a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedValidator

public ChainedValidator()

ChainedValidator

public ChainedValidator(Object validatingBean)

ChainedValidator

public ChainedValidator(Object validatingBean,
                        Validator nextInChain)
Method Detail

getValidatingBean

protected Object getValidatingBean()

getNextInChain

protected Validator getNextInChain()

getPropertyConstraint

public Constraint getPropertyConstraint(String propertyName,
                                        String constraintName)
Description copied from interface: Validator
Retrieves validation meta-data about a property.

Specified by:
getPropertyConstraint in interface Validator
Parameters:
propertyName - the name of the property
constraintName - the name of the constraint to be retrieved
Returns:
the constraint of the given property with the given name if it exists, null otherwise

getPropertyConstraints

public Collection<Constraint> getPropertyConstraints(String propertyName)
Description copied from interface: Validator
Retrieves validation meta-data about a property.

Specified by:
getPropertyConstraints in interface Validator
Parameters:
propertyName - the name of the property
Returns:
a collection of Constraint objects each containing a constraint description

itselfGetPropertyConstraints

protected abstract Collection<Constraint> itselfGetPropertyConstraints(String propertyName)

validateBean

public ValidationResult validateBean()
Description copied from interface: Validator
Check if an object is valid as a whole.

Specified by:
validateBean in interface Validator
Returns:
a ValidationResult object whose type is ValidationResult.ResultType.VALID if the object is valid, otherwise a ValidationResult object whose type is ValidationResult.ResultType.INVALID

itselfValidateBean

protected abstract ValidationResult itselfValidateBean()

validateProperty

public ValidationResult validateProperty(String propertyName,
                                         Object value)
Description copied from interface: Validator
Check if a value is valid for a property.

Specified by:
validateProperty in interface Validator
Parameters:
propertyName - the name of the property to be checked
value - the value to be checked
Returns:
a ValidationResult object whose type is ValidationResult.ResultType.VALID if the value is valid for the property, otherwise a ValidationResult object whose type is ValidationResult.ResultType.INVALID

itselfValidateProperty

protected abstract ValidationResult itselfValidateProperty(String propertyName,
                                                           Object value)


Copyright © 2011. All Rights Reserved.