Class FolderValidator
java.lang.Object
com.broadleafcommerce.asset.service.validation.FolderValidator
- All Implemented Interfaces:
- com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
public class FolderValidator
extends Object
implements com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
Validations for 
Folder.- Author:
- Samarth Dhruva (samarthd)
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected FolderService<Folder>voidsetFolderService(FolderService<Folder> folderService) 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 voidvalidateLastUpdatedDate(Folder folder, org.springframework.validation.Errors errors) protected voidvalidateName(org.springframework.validation.Errors errors) protected voidvalidateParentFolderId(Folder folder, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidatorvalidateForCreate, validateForReplace, validateForUpdate
- 
Constructor Details- 
FolderValidatorpublic FolderValidator()
 
- 
- 
Method Details- 
setFolderServiceLazy injection since this validator is itself a service component. This avoids circular dependency exceptions- Parameters:
- folderService- the folder service
 
- 
supportspublic boolean supports(Class<?> serviceClass, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
- supportsin interface- com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
 
- 
validatepublic void validate(@NonNull Object businessInstance, @NonNull org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) - Specified by:
- validatein interface- com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
 
- 
validateNameprotected void validateName(org.springframework.validation.Errors errors) 
- 
validateLastUpdatedDate
- 
validateParentFolderIdprotected void validateParentFolderId(Folder folder, org.springframework.validation.Errors errors, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
- 
getFolderService
 
-