Class MarketplaceApplicationCatalogValidator
java.lang.Object
com.broadleafcommerce.tenant.service.validation.MarketplaceApplicationCatalogValidator
A validator specifically intended for use in the
MarketplaceApplicationCatalogService
. It
intentionally does not implement EntityValidator
, as it does not apply in the normal CRUD
flow.- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorDescriptionMarketplaceApplicationCatalogValidator
(ApplicationService<Application> applicationService) -
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationService<Application>
Lazy injection to avoid circular dependency exceptions.protected String
prefixWithValidationMessageKey
(String errorCode) void
setMarketplaceApplicationCatalogService
(MarketplaceApplicationCatalogService<MarketplaceApplicationCatalog> marketplaceApplicationCatalogService) Lazy injection to avoid circular dependency exceptions.void
validateForCreate
(String applicationId, @NonNull Catalog catalog, @NonNull MarketplaceApplicationCatalog applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
create request is valid when compared to the contextual applicationId and the catalog type.void
validateForDelete
(String applicationId, @NonNull MarketplaceApplicationCatalog applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
delete request is valid when compared to the contextual applicationId.void
validateForReplace
(String applicationId, @NonNull MarketplaceApplicationCatalog original, @NonNull MarketplaceApplicationCatalog replacement, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
update or replace request is valid when compared to the existing instance.
-
Constructor Details
-
MarketplaceApplicationCatalogValidator
-
-
Method Details
-
validateForCreate
public void validateForCreate(@Nullable String applicationId, @NonNull @NonNull Catalog catalog, @NonNull @NonNull MarketplaceApplicationCatalog applicationCatalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
create request is valid when compared to the contextual applicationId and the catalog type. The catalog must be of a vendor type, which specifically means theCatalog.getVendorRef()
must not be null.- Parameters:
applicationId
- The contextual applicationcatalog
- The requested catalogapplicationCatalog
- The requested entity to createcontextInfo
- The current request context informationerrors
- The container for any errors that should be bubbled back to the caller's API request
-
validateForReplace
public void validateForReplace(@Nullable String applicationId, @NonNull @NonNull MarketplaceApplicationCatalog original, @NonNull @NonNull MarketplaceApplicationCatalog replacement, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
update or replace request is valid when compared to the existing instance. The catalog, application, and implicit catalog values may not be changed.- Parameters:
applicationId
- The contextual applicationoriginal
- The original entity instancereplacement
- The requested replacementcontextInfo
- The current request context informationerrors
- The container for any erros that should be bubbled back to the caller's API request
-
validateForDelete
public void validateForDelete(@Nullable String applicationId, @NonNull @NonNull MarketplaceApplicationCatalog applicationCatalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @NonNull @NonNull org.springframework.validation.Errors errors) Validate theMarketplaceApplicationCatalog
delete request is valid when compared to the contextual applicationId.- Parameters:
applicationId
- The contextual applicationapplicationCatalog
- The requested entity to createcontextInfo
- The current request context informationerrors
- The container for any errors that should be bubbled back to the caller's API request
-
prefixWithValidationMessageKey
-
getApplicationService
-
getMarketplaceApplicationCatalogService
protected MarketplaceApplicationCatalogService<MarketplaceApplicationCatalog> getMarketplaceApplicationCatalogService()Lazy injection to avoid circular dependency exceptions. -
setMarketplaceApplicationCatalogService
@Autowired @Lazy public void setMarketplaceApplicationCatalogService(MarketplaceApplicationCatalogService<MarketplaceApplicationCatalog> marketplaceApplicationCatalogService) Lazy injection to avoid circular dependency exceptions.
-