Class DelegatingValidator

java.lang.Object
net.solarnetwork.central.support.DelegatingValidator
All Implemented Interfaces:
org.springframework.validation.SmartValidator, org.springframework.validation.Validator

public class DelegatingValidator extends Object implements org.springframework.validation.SmartValidator
Validator that delegates to other validators based on the class of the object being validated.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DelegatingValidator(Map<String,org.springframework.validation.Validator> validators)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    supports(Class<?> clazz)
     
    void
    validate(Object target, org.springframework.validation.Errors errors)
     
    void
    validate(Object target, org.springframework.validation.Errors errors, Object... validationHints)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.validation.SmartValidator

    unwrap, validateValue

    Methods inherited from interface org.springframework.validation.Validator

    validateObject
  • Constructor Details

    • DelegatingValidator

      public DelegatingValidator(Map<String,org.springframework.validation.Validator> validators)
      Constructor.
      Parameters:
      validators - the validators
  • Method Details

    • supports

      public boolean supports(Class<?> clazz)
      Specified by:
      supports in interface org.springframework.validation.Validator
    • validate

      public void validate(Object target, org.springframework.validation.Errors errors)
      Specified by:
      validate in interface org.springframework.validation.Validator
    • validate

      public void validate(Object target, org.springframework.validation.Errors errors, Object... validationHints)
      Specified by:
      validate in interface org.springframework.validation.SmartValidator