Class BasicFieldTypeValidator
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.validation.BasicFieldTypeValidator
- All Implemented Interfaces:
PopulateValueRequestValidator,org.springframework.core.Ordered
@Component("blBasicFieldTypeValidator")
public class BasicFieldTypeValidator
extends Object
implements PopulateValueRequestValidator
Validates that values are actually of their required types before trying to populate it. Integers should be integers,
dates should parse correctly, etc.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()validate(PopulateValueRequest populateValueRequest, Serializable instance) Validates a population request prior to invoking anyFieldPersistenceProviders.
-
Constructor Details
-
BasicFieldTypeValidator
public BasicFieldTypeValidator()
-
-
Method Details
-
validate
public PropertyValidationResult validate(PopulateValueRequest populateValueRequest, Serializable instance) Description copied from interface:PopulateValueRequestValidatorValidates a population request prior to invoking anyFieldPersistenceProviders. If no validation could be performed for the givenPopulateValueRequestthen return true to let it pass on to a differentPopulateValueRequestValidatoror on to aFieldPersistenceProvider.- Specified by:
validatein interfacePopulateValueRequestValidator- Parameters:
populateValueRequest- thePopulateValueRequestthat should be validatedinstance- the Hibernate entity that will attempt to be populated- Returns:
- false if the
PopulateValueRequestfailed validation. In this case, the request should not be passed to anyFieldPersistenceProviders.
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-