Class AbstractTypeFulfillmentGroupSubmitValidator

java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.validation.type.AbstractTypeFulfillmentGroupSubmitValidator
All Implemented Interfaces:
FulfillmentValidator, TypeFulfillmentGroupSubmitValidator, org.springframework.validation.SmartValidator, org.springframework.validation.Validator
Direct Known Subclasses:
PickupTypeFulfillmentGroupSubmitValidator, ShipTypeFulfillmentGroupSubmitValidator, VirtualTypeFulfillmentGroupSubmitValidator

public abstract class AbstractTypeFulfillmentGroupSubmitValidator extends Object implements TypeFulfillmentGroupSubmitValidator
Holds common logic for validating different fulfillment types (address validation).
Author:
Jacob Mitash
  • Constructor Details

  • Method Details

    • 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
    • shouldValidateAddress

      protected abstract boolean shouldValidateAddress(Set<Object> hints)
      Tells whether this validator should validate the address or not.
      Parameters:
      hints - hints to use when determining whether or not to validate the address
      Returns:
      true to validate the address, false otherwise
    • validateAddress

      protected void validateAddress(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints)
      Validates the address (if required by shouldValidateAddress(Set)).
      Parameters:
      group - the fulfillment group of which to validate the address
      errors - error container to place validation errors in
      hints - any hints to use during validation
    • getAddressValidators

      protected Set<FulfillmentAddressSubmitValidator> getAddressValidators()