it.amattioli.dominate.validation
Class DefaultValidator

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

public class DefaultValidator
extends ChainedValidator

A default implementation of the Validator interface.

This implementation can perform validation in two distinct ways:

To validate a property using Hibernate Validator simply annotate one of its accessor methods with a Hibernate Validator compliant annotation.

To validate a property using validation methods you have to create a public method in the validating class whose name must be of the form:

public ValidationResult validatePropertyName(PropertyClass validatingValue)

Author:
andrea

Constructor Summary
DefaultValidator(Object validatingBean)
           
 
Method Summary
protected  Collection<Constraint> itselfGetPropertyConstraints(String propertyName)
           
protected  ValidationResult itselfValidateBean()
           
protected  ValidationResult itselfValidateProperty(String propertyName, Object value)
           
 
Methods inherited from class it.amattioli.dominate.validation.ChainedValidator
getNextInChain, getPropertyConstraint, getPropertyConstraints, getValidatingBean, validateBean, validateProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultValidator

public DefaultValidator(Object validatingBean)
Method Detail

itselfValidateBean

protected ValidationResult itselfValidateBean()
Specified by:
itselfValidateBean in class ChainedValidator

itselfValidateProperty

protected ValidationResult itselfValidateProperty(String propertyName,
                                                  Object value)
Specified by:
itselfValidateProperty in class ChainedValidator

itselfGetPropertyConstraints

protected Collection<Constraint> itselfGetPropertyConstraints(String propertyName)
Specified by:
itselfGetPropertyConstraints in class ChainedValidator


Copyright © 2011. All Rights Reserved.