Class OrderFulfillmentNoteValidator<P extends OrderFulfillmentNote>

java.lang.Object
com.broadleafcommerce.order.service.validation.OrderFulfillmentNoteValidator<P>
Type Parameters:
P - A OrderFulfillmentNote 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 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 interface com.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 interface com.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 the OrderFulfillment exists for the OrderFulfillmentNote.
      Parameters:
      orderFulfillmentNote - order fulfillment note to check if its fulfillment exists
      errors - holder for validation context information
      context - current context this validation is running in
    • prefixWithEntityValidationMessageKey

      protected String prefixWithEntityValidationMessageKey(String errorCode)
    • getOrderFulfillmentService

      protected OrderFulfillmentService<com.broadleafcommerce.order.client.domain.OrderFulfillment> getOrderFulfillmentService()