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 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 Details

    • RuleValidatorManager

      public RuleValidatorManager(List<RuleValidator> ruleValidators)
  • Method Details

    • 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 interface EntityValidator
      Parameters:
      serviceClass - the
      context - 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 interface EntityValidator
      Parameters:
      businessInstance - representation of the repositoryInstance
      errors - holder for validation context information. When adding field validation errors, the field names should be in the context of the businessInstance
      context - current context this validation is running in