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 forDefaultB2BAccountAddressTypes.BILL_TO
&DefaultB2BAccountAddressTypes.SHIP_TO
addresses.
-
-
Constructor Summary
Constructors Constructor Description DefaultB2BAccountAddressValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
Method Detail
-
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
-
-