org.acegisecurity.domain.validation
Class ValidationManagerImpl

java.lang.Object
  extended by org.acegisecurity.domain.validation.ValidationManagerImpl
All Implemented Interfaces:
ValidationManager, InitializingBean

public class ValidationManagerImpl
extends Object
implements InitializingBean, ValidationManager

Default implementation of ValidationManager.

Version:
$Id: ValidationManagerImpl.java,v 1.9 2005/11/17 00:55:50 benalex Exp $
Author:
Ben Alex, Matthew E. Porter

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
ValidationManagerImpl()
           
 
Method Summary
 void afterPropertiesSet()
           
 IntrospectionManager getIntrospectionManager()
           
 ValidationRegistryManager getValidationRegistryManager()
           
 boolean isStrictValidation()
           
 void setIntrospectionManager(IntrospectionManager introspectionManager)
           
 void setStrictValidation(boolean strictValidation)
          Indicates whether a ValidatorNotFoundException should be thrown if any domain object does not have a corresponding Validator.
 void setValidationRegistryManager(ValidationRegistryManager validationRegistryManager)
           
 void validate(Object domainObject)
          Validates the passed domain object, along with any children, grandchildren, great-grandchildren etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

ValidationManagerImpl

public ValidationManagerImpl()
Method Detail

setIntrospectionManager

public void setIntrospectionManager(IntrospectionManager introspectionManager)

getIntrospectionManager

public IntrospectionManager getIntrospectionManager()

setStrictValidation

public void setStrictValidation(boolean strictValidation)
Indicates whether a ValidatorNotFoundException should be thrown if any domain object does not have a corresponding Validator.

Defaults to true. This is a reasonable default, as callers of ValidationManager should expect the object to support validation.

Parameters:
strictValidation - set to false if you wish to silently ignore any domain object that is missing a Validator

isStrictValidation

public boolean isStrictValidation()

setValidationRegistryManager

public void setValidationRegistryManager(ValidationRegistryManager validationRegistryManager)

getValidationRegistryManager

public ValidationRegistryManager getValidationRegistryManager()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

validate

public void validate(Object domainObject)
              throws BindException,
                     ValidatorNotFoundException
Validates the passed domain object, along with any children, grandchildren, great-grandchildren etc.

Specified by:
validate in interface ValidationManager
Parameters:
domainObject - to validate (cannot be null)
Throws:
BindException - if a validation problem occurs
ValidatorNotFoundException - if no matching Validator could be found for the object or its children (only ever thrown if the strictValidation) was set to true).


Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.