Class DefaultFulfillmentAddressSubmitValidator

java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.validation.address.DefaultFulfillmentAddressSubmitValidator
All Implemented Interfaces:
FulfillmentAddressSubmitValidator, FulfillmentValidator, org.springframework.validation.SmartValidator, org.springframework.validation.Validator

public class DefaultFulfillmentAddressSubmitValidator extends Object implements FulfillmentAddressSubmitValidator
Performs basic validation of the address of a fulfillment group to ensure required fields are present.
Author:
Jacob Mitash
  • Constructor Details

    • DefaultFulfillmentAddressSubmitValidator

      public DefaultFulfillmentAddressSubmitValidator()
  • Method Details

    • supports

      public boolean supports(com.broadleafcommerce.order.common.domain.Address address)
      Description copied from interface: FulfillmentAddressSubmitValidator
      Tells if this validator supports the given fulfillment group address.
      Specified by:
      supports in interface FulfillmentAddressSubmitValidator
      Parameters:
      address - the fulfillment group address to test support of
      Returns:
      true if this supports validation of the given address, false otherwise
    • getSupportedClass

      public Class<?> getSupportedClass()
      Description copied from interface: FulfillmentValidator
      Gets the class that this validator supports.
      Specified by:
      getSupportedClass in interface FulfillmentValidator
      Returns:
      the class that this validator support
    • validate

      public void validate(@NonNull @NonNull Object target, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> validationHints)
      Description copied from interface: FulfillmentValidator
      Validates the target.
      Specified by:
      validate in interface FulfillmentValidator
      Parameters:
      target - the target of the validation
      errors - an errors container to place rejections and pull values from
      validationHints - any hints that should be used during validation
    • validateAddress

      protected void validateAddress(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateName

      protected void validateName(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the name on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateEmailAddress

      protected void validateEmailAddress(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the email address on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateCompanyName

      protected void validateCompanyName(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the company name on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateAddressLine1

      protected void validateAddressLine1(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the address line 1 on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateCity

      protected void validateCity(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the city on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateCounty

      protected void validateCounty(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the county on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateCountry

      protected void validateCountry(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the country on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validateStateProvinceRegionSubdivision

      protected void validateStateProvinceRegionSubdivision(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the state province region on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validatePostalCode

      protected void validatePostalCode(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the postal code on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • validatePhonePrimary

      protected void validatePhonePrimary(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Address address, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the primary phone number on the address.
      Parameters:
      address - the address to validate
      errors - an errors container to place rejections and pull values from
      hints - any hints that should be used during the validation
    • useFullName

      protected boolean useFullName(@NonNull @NonNull Set<Object> hints)
      Tells if the full name or the individual first and last name should be used for validation.
      Parameters:
      hints - any hints to take into account when deciding which name type should be validated
      Returns:
      true if validation should use the full name, false if validation should use the first and last