Class RuleValidatorManager
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.mapping.validation.rules.RuleValidatorManager
-
- All Implemented Interfaces:
EntityValidator
public class RuleValidatorManager extends Object implements EntityValidator
EntityValidator
that specializes in compiling a list of allRuleValidate
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
Constructors Constructor Description RuleValidatorManager(List<RuleValidator> ruleValidators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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 Detail
-
RuleValidatorManager
public RuleValidatorManager(List<RuleValidator> ruleValidators)
-
-
Method Detail
-
supports
public boolean supports(Class<?> serviceClass, ContextInfo context)
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
-
-