Class EntityFormValidator
java.lang.Object
org.broadleafcommerce.openadmin.web.form.entity.EntityFormValidator
Validator used at the controller level to ensure that an Entity has passed validation from the PersistenceModule or
CustomPersistenceHandler. This should be used as a final validation step after attempting the save
- Author:
- Phillip Verheyden
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvalidate(EntityForm form, Map<String, List<String>> propertyErrors, List<String> globalErrors, org.springframework.validation.Errors errors) Validates the form DTO against the passed in map of propertyErrors along with global validation errors.booleanvalidate(EntityForm form, Map<String, List<String>> propertyErrors, org.springframework.validation.Errors errors) Validates the DTO against the map of property errors.booleanvalidate(EntityForm form, Entity entity, org.springframework.validation.Errors errors) Validates the form DTO against the passed in entity
-
Constructor Details
-
EntityFormValidator
public EntityFormValidator()
-
-
Method Details
-
validate
public boolean validate(EntityForm form, Map<String, List<String>> propertyErrors, org.springframework.validation.Errors errors) Validates the DTO against the map of property errors. Note that this method does not support global validation errors fromEntity.getGlobalValidationErrors()as they might not make sense.- Parameters:
form-propertyErrors-errors-- Returns:
-
validate
public boolean validate(EntityForm form, Map<String, List<String>> propertyErrors, List<String> globalErrors, org.springframework.validation.Errors errors) Validates the form DTO against the passed in map of propertyErrors along with global validation errors.- Parameters:
form-propertyErrors-globalErrors-errors-- Returns:
- See Also:
-
validate
public boolean validate(EntityForm form, Entity entity, org.springframework.validation.Errors errors) Validates the form DTO against the passed in entity- Parameters:
form- the form DTOentity- value obtained after attempting to save viaAdminEntityService#updateEntity(EntityForm, String)- Returns:
- true if entity does not have any validation errors, false otherwise.
-