Class RuleValidatorManager
java.lang.Object
com.broadleafcommerce.data.tracking.core.mapping.validation.rules.RuleValidatorManager
- All Implemented Interfaces:
EntityValidator
EntityValidator
that specializes in compiling a list of all RuleValidate
annotated fields in a projection object to be validated. Also, perform validation on the contents
of all those fields for formatting acceptability, including confirming the absence of code
injection problems.- Author:
- Jeff Fischer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
supports
(Class<?> serviceClass, ContextInfo context) Whether or not this validator supports validating the given service classvoid
validate
(Object businessInstance, org.springframework.validation.Errors errors, ContextInfo context) Default validation that handles create, replace and update.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
-
RuleValidatorManager
-
-
Method Details
-
supports
Description copied from interface:EntityValidator
Whether or not this validator supports validating the given service class- Specified by:
supports
in interfaceEntityValidator
- Parameters:
serviceClass
- thecontext
- what context this validator is running in- Returns:
- whether or not this validator should be executed
-
validate
public void validate(Object businessInstance, org.springframework.validation.Errors errors, ContextInfo context) Description copied from interface:EntityValidator
Default validation that handles create, replace and update. This is invoked by default by each individual lifecycle method and is available as a simple override point for global validation that should apply to all contexts.
- Specified by:
validate
in interfaceEntityValidator
- Parameters:
businessInstance
- representation of the repositoryInstanceerrors
- holder for validation context information. When adding field validation errors, the field names should be in the context of the businessInstancecontext
- current context this validation is running in
-