Class ApplicationValidator

java.lang.Object
com.broadleafcommerce.tenant.service.validation.ApplicationValidator
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator

public class ApplicationValidator extends Object implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for Application.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    fetchAndValidateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Performs deeper validation on existence and vendor-associations of assigned isolated catalogs.
    Lazy injection to avoid circular dependency exceptions.
    void
    Lazy injection to avoid circular dependency exceptions.
    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
    validateIdentifierType(org.springframework.validation.Errors errors)
     
    protected void
    validateIdentifierValue(org.springframework.validation.Errors errors)
     
    protected void
    validateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors)
    This just performs basic field validations on the requested isolated catalogs.
    protected void
    validateName(org.springframework.validation.Errors errors)
     

    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

    • ApplicationValidator

      public ApplicationValidator()
  • Method Details

    • 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(@NonNull Object businessInstance, @NonNull 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
    • validateName

      protected void validateName(org.springframework.validation.Errors errors)
    • validateIdentifierType

      protected void validateIdentifierType(org.springframework.validation.Errors errors)
    • validateIdentifierValue

      protected void validateIdentifierValue(org.springframework.validation.Errors errors)
    • validateIsolatedCatalogs

      protected void validateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors)
      This just performs basic field validations on the requested isolated catalogs. For deeper validations, see fetchAndValidateIsolatedCatalogs(Application, Errors, ContextInfo).
      Parameters:
      application - the application whose isolated catalogs should be validated
      errors - errors instance on which to register errors
    • fetchAndValidateIsolatedCatalogs

      protected void fetchAndValidateIsolatedCatalogs(Application application, org.springframework.validation.Errors errors, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Performs deeper validation on existence and vendor-associations of assigned isolated catalogs. Should only be run after all other basic field validations pass, such as validateIsolatedCatalogs(Application, Errors).
      Parameters:
      application - the application whose isolated catalogs should be validated
      errors - errors instance on which to register errors
      contextInfo - context information around multitenant state
    • getCatalogService

      protected CatalogService<Catalog> getCatalogService()
      Lazy injection to avoid circular dependency exceptions.
    • setCatalogService

      @Autowired @Lazy public void setCatalogService(CatalogService<Catalog> catalogService)
      Lazy injection to avoid circular dependency exceptions.