Class OrderFulfillmentNoteValidator<P extends OrderFulfillmentNote>
java.lang.Object
com.broadleafcommerce.order.service.validation.OrderFulfillmentNoteValidator<P>
- Type Parameters:
P- AOrderFulfillmentNoteor subclass
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class OrderFulfillmentNoteValidator<P extends OrderFulfillmentNote>
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for
OrderFulfillmentNote. Validates that
OrderFulfillmentNote.getOrderFulfillmentId() and OrderFulfillmentNote.getNote()
are not empty, and that the order fulfillment specified by
OrderFulfillmentNote.getOrderFulfillmentId() exists.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment>protected StringprefixWithEntityValidationMessageKey(String errorCode) voidsetOrderFulfillmentService(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService) Lazy injection since this validator is itself a service component.booleansupports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) voidvalidate(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected voidvalidateExistingOrderFulfillment(P orderFulfillmentNote, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Validates that theOrderFulfillmentexists for theOrderFulfillmentNote.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
validateForCreate, validateForReplace, validateForUpdate
-
Constructor Details
-
OrderFulfillmentNoteValidator
public OrderFulfillmentNoteValidator()
-
-
Method Details
-
setOrderFulfillmentService
@Autowired @Lazy public void setOrderFulfillmentService(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService) Lazy injection since this validator is itself a service component. This avoids circular dependency exceptions.- Parameters:
orderFulfillmentService- the order fulfillment service
-
supports
public boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
supportsin interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validate
public void validate(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
validatein interfacecom.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
-
validateExistingOrderFulfillment
protected void validateExistingOrderFulfillment(P orderFulfillmentNote, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Validates that theOrderFulfillmentexists for theOrderFulfillmentNote.- Parameters:
orderFulfillmentNote- order fulfillment note to check if its fulfillment existserrors- holder for validation context informationcontext- current context this validation is running in
-
prefixWithEntityValidationMessageKey
-
getOrderFulfillmentService
protected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> getOrderFulfillmentService()
-