org.broadleafcommerce.openadmin.server.service.persistence.validation
Interface PopulateValueRequestValidator

All Known Implementing Classes:
BasicFieldTypeValidator

public interface PopulateValueRequestValidator

This is injected into the BasicPersistenceModule and invoked prior to any attempts to actually populate values from the Entity DTO representation into the Hibernate entity using the FieldPersistenceProvider paradigm.

An example validator would ensure that Booleans are actually booleans, integers are actually integers, etc. since all values come in as Strings by default

Author:
Phillip Verheyden (phillipuniverse)
See Also:
FieldPersistenceProvider}, PopulateValueRequest}, BasicPersistenceModule#createPopulatedInstance(Serializable, Entity, java.util.Map, Boolean)}

Method Summary
 PropertyValidationResult validate(PopulateValueRequest populateValueRequest, Serializable instance)
          Validates a population request prior to invoking any FieldPersistenceProviders.
 

Method Detail

validate

PropertyValidationResult validate(PopulateValueRequest populateValueRequest,
                                  Serializable instance)
Validates a population request prior to invoking any FieldPersistenceProviders. If no validation could be performed for the given PopulateValueRequest then return true to let it pass on to a different PopulateValueRequestValidator or on to a FieldPersistenceProvider.

Parameters:
populateValueRequest - the PopulateValueRequest that should be validated
instance - the Hibernate entity that will attempt to be populated
Returns:
false if the PopulateValueRequest failed validation. In this case, the request should not be passed to any FieldPersistenceProviders.


Copyright © 2013. All Rights Reserved.