Class DefaultB2BAccountAddressValidator<P extends AccountAddress>
java.lang.Object
com.broadleafcommerce.customer.service.validation.DefaultB2BAccountAddressValidator<P>
- Type Parameters:
P
- AAccountAddress
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
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 numberMethods 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 interfacecom.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 interfacecom.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
- theAccountAddress
to validateerrors
- the errors object bound to theaccountAddress
on which errors can be registered
-