org.broadleafcommerce.openadmin.server.service.persistence.validation
Interface GlobalPropertyValidator
- All Known Implementing Classes:
- RequiredPropertyValidator
public interface GlobalPropertyValidator
Analagous to PropertyValidator except this does not attempt to use any ValidationConfiguration from an
AdminPresentation annotation. These global validators will execute on every field of every entity that is
attempted to be populated by the admin
- Author:
- Phillip Verheyden (phillipuniverse)
- See Also:
PropertyValidator},
EntityValidatorService#getGlobalEntityValidators()},
BasicPersistenceModule#createPopulatedInstance(Serializable, Entity, Map, Boolean)}
validate
PropertyValidationResult validate(Entity entity,
Serializable instance,
Map<String,FieldMetadata> entityFieldMetadata,
BasicFieldMetadata propertyMetadata,
String propertyName,
String value)
- Validates a property for an entity
- Parameters:
entity - Entity DTO of the entity attempting to saveinstance - actual object representation of entity. This can be cast to entity interfaces (like Sku or
Product)entityFieldMetadata - complete field metadata for all properties in entitypropertyMetadata - BasicFieldMetadata corresponding to the property that is being validpropertyName - the property name of the value attempting to be saved (could be a sub-entity obtained via dot
notation like 'defaultSku.name')value - the value attempted to be saved
- Returns:
- true if this passes validation, false otherwise.
Copyright © 2013. All Rights Reserved.