Class DefaultFulfillmentGroupSubmitValidator
java.lang.Object
com.broadleafcommerce.cartoperation.service.fulfillment.validation.DefaultFulfillmentGroupSubmitValidator
- All Implemented Interfaces:
- FulfillmentGroupSubmitValidator,- FulfillmentValidator,- org.springframework.validation.SmartValidator,- org.springframework.validation.Validator
public class DefaultFulfillmentGroupSubmitValidator
extends Object
implements FulfillmentGroupSubmitValidator
Performs validation for a fulfillment group. This mainly delegates to other validators that are
 able to validate with more specific conditions.
- Author:
- Jacob Mitash
- 
Field SummaryFields inherited from interface com.broadleafcommerce.cartoperation.service.fulfillment.validation.FulfillmentGroupSubmitValidatorHINT_ALLOW_NO_ITEMS, HINT_ALLOW_NO_OPTION, HINT_PRICED_FULFILLMENT_OPTION, HINT_PRICING_NOT_REQUIRED, HINT_SKIP_ITEM_VALIDATION, HINT_SKIP_OPTION_VALIDATION, HINT_SKIP_TYPE_SPECIFIC_VALIDATION
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultFulfillmentGroupSubmitValidator(Set<TypeFulfillmentGroupSubmitValidator> typeValidators, Set<FulfillmentItemSubmitValidator> itemValidators, Set<FulfillmentOptionSubmitValidator> optionValidators) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected Set<FulfillmentItemSubmitValidator>protected Set<FulfillmentOptionSubmitValidator>protected Set<PricedFulfillmentOptionSubmitValidator>Class<?>Gets the class that this validator supports.protected Set<TypeFulfillmentGroupSubmitValidator>Produces a set of field names of pricing fields that should be validated.voidsetPricedFulfillmentOptionSubmitValidators(Set<PricedFulfillmentOptionSubmitValidator> pricedFulfillmentOptionSubmitValidators) voidvalidate(@NonNull Object target, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints) Validates the target.protected voidvalidateBase(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints) Validates a fulfillment group at the top level, not considering nested or pricing fields.protected voidvalidateItems(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints) Validates the fulfillment items of the group.protected voidvalidateOptions(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints) Validates the fulfillment option on this group.protected voidvalidateOptions(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints, FulfillmentValidationDataHolder dataHolder) protected voidvalidatePricing(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints) Validates the price fields on the fulfillment group (top-level only- does not consider individual item prices).voidvalidateWithDataHolder(@NonNull Object target, @NonNull org.springframework.validation.Errors errors, @NonNull Set<Object> hints, @NonNull FulfillmentValidationDataHolder dataHolder) Validates the target and usesFulfillmentValidationDataHolderparameter that can be used to hold some additional data needed for the validation.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.cartoperation.service.fulfillment.validation.FulfillmentValidatorsupports, validate, validate, validate, validateMethods inherited from interface org.springframework.validation.SmartValidatorvalidateValue
- 
Constructor Details- 
DefaultFulfillmentGroupSubmitValidatorpublic DefaultFulfillmentGroupSubmitValidator(Set<TypeFulfillmentGroupSubmitValidator> typeValidators, Set<FulfillmentItemSubmitValidator> itemValidators, Set<FulfillmentOptionSubmitValidator> optionValidators) 
 
- 
- 
Method Details- 
getSupportedClassDescription copied from interface:FulfillmentValidatorGets the class that this validator supports.- Specified by:
- getSupportedClassin interface- FulfillmentValidator
- Returns:
- the class that this validator support
 
- 
validatepublic void validate(@NonNull @NonNull Object target, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints) Description copied from interface:FulfillmentValidatorValidates the target.- Specified by:
- validatein interface- FulfillmentValidator
- Parameters:
- target- the target of the validation
- errors- an errors container to place rejections and pull values from
- hints- any hints that should be used during validation
 
- 
validateWithDataHolderpublic void validateWithDataHolder(@NonNull @NonNull Object target, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints, @NonNull @NonNull FulfillmentValidationDataHolder dataHolder) Description copied from interface:FulfillmentValidatorValidates the target and usesFulfillmentValidationDataHolderparameter that can be used to hold some additional data needed for the validation.- Specified by:
- validateWithDataHolderin interface- FulfillmentValidator
- Parameters:
- target- the target of the validation
- errors- an errors container to place rejections and pull values from
- hints- any hints that should be used during validation
- dataHolder- the state holder that can be used to store some additional data required for validation
 
- 
validateBaseprotected void validateBase(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints) Validates a fulfillment group at the top level, not considering nested or pricing fields. By default, this will also delegate totypeValidatorsto validate things that would be specific to the fulfillment type being used.- Parameters:
- group- the fulfillment group to validate
- errors- an error container to place validation errors in
- hints- any hints to use when validating the group
 
- 
validatePricingprotected void validatePricing(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints) Validates the price fields on the fulfillment group (top-level only- does not consider individual item prices).- Parameters:
- group- the fulfillment group to validate
- errors- an error container to place validation errors in
- hints- any hints to use when validating the group
 
- 
validateItemsprotected void validateItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints) Validates the fulfillment items of the group. Delegates toitemValidatorsfor the actual validation.- Parameters:
- group- the fulfillment group to validate
- errors- an error container to place validation errors in
- hints- any hints to use when validating the group
 
- 
validateOptionsprotected void validateOptions(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints) Validates the fulfillment option on this group. Delegates tooptionValidators.- Parameters:
- group- the fulfillment group to validate
- errors- an error container to place validation errors in
- hints- any hints to use when validating the group
 
- 
validateOptionsprotected void validateOptions(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup group, @NonNull @NonNull org.springframework.validation.Errors errors, @NonNull @NonNull Set<Object> hints, @Nullable FulfillmentValidationDataHolder dataHolder) 
- 
pricingFieldsProduces a set of field names of pricing fields that should be validated. These are the simple field names (i.e. no nested paths).- Returns:
- the price field names
 
- 
getTypeValidators
- 
getItemValidators
- 
getOptionValidators
- 
getPricedFulfillmentOptionSubmitValidators
- 
setPricedFulfillmentOptionSubmitValidators@Autowired(required=false) public void setPricedFulfillmentOptionSubmitValidators(Set<PricedFulfillmentOptionSubmitValidator> pricedFulfillmentOptionSubmitValidators) 
- 
getPricingFields
 
-