Class DefaultB2BAccountAddressValidator<P extends AccountAddress>

java.lang.Object
com.broadleafcommerce.customer.service.validation.DefaultB2BAccountAddressValidator<P>
Type Parameters:
P - A AccountAddress or subclass of AccountAddress.
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

public class DefaultB2BAccountAddressValidator<P extends AccountAddress> extends Object implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Default account address validator. Applies specific validation for DefaultB2BAccountAddressTypes.BILL_TO & DefaultB2BAccountAddressTypes.SHIP_TO addresses.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    void
    validate(@NonNull Object entity, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected void
    validateBillToAddress(@NonNull AccountAddress accountAddress, @NonNull org.springframework.validation.Errors errors)
    Guarantee that B2B "Bill To" AccountAddresses have an email address & primary phone number

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

    validateForCreate, validateForReplace, validateForUpdate
  • Constructor Details

    • DefaultB2BAccountAddressValidator

      public DefaultB2BAccountAddressValidator()
  • Method Details

    • supports

      public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      supports in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validate

      public void validate(@NonNull @NonNull Object entity, @NonNull @NonNull org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      validate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
    • validateBillToAddress

      protected void validateBillToAddress(@NonNull @NonNull AccountAddress accountAddress, @NonNull @NonNull org.springframework.validation.Errors errors)
      Guarantee that B2B "Bill To" AccountAddresses have an email address & primary phone number
      Parameters:
      accountAddress - the AccountAddress to validate
      errors - the errors object bound to the accountAddress on which errors can be registered