Class EntityFormValidator

java.lang.Object
org.broadleafcommerce.openadmin.web.form.entity.EntityFormValidator

@Component("blEntityFormValidator") public class EntityFormValidator extends Object
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 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 from Entity.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 DTO
      entity - value obtained after attempting to save via AdminEntityService#updateEntity(EntityForm, String)
      Returns:
      true if entity does not have any validation errors, false otherwise.