Class OrderFulfillmentNoteValidator<P extends OrderFulfillmentNote>
java.lang.Object
com.broadleafcommerce.order.service.validation.OrderFulfillmentNoteValidator<P>
- Type Parameters:
P
- AOrderFulfillmentNote
or 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 String
prefixWithEntityValidationMessageKey
(String errorCode) void
setOrderFulfillmentService
(OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillmentService) Lazy injection since this validator is itself a service component.boolean
supports
(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) void
validate
(Object businessInstance, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected void
validateExistingOrderFulfillment
(P orderFulfillmentNote, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Validates that theOrderFulfillment
exists for theOrderFulfillmentNote
.Methods 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
-
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:
supports
in 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:
validate
in 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 theOrderFulfillment
exists 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()
-