Class AbstractConstraintAdapter<T>

java.lang.Object
io.avaje.validation.adapter.AbstractConstraintAdapter<T>
All Implemented Interfaces:
ValidationAdapter<T>
Direct Known Subclasses:
PrimitiveAdapter

public abstract class AbstractConstraintAdapter<T> extends Object implements ValidationAdapter<T>
Abstract Adapter that validates objects based on Constraint Annotations.
  • Field Details

  • Constructor Details

  • Method Details

    • isValid

      protected abstract boolean isValid(T value)
      Execute Constraint validations for the given object.
      Parameters:
      value - the object to validate
      Returns:
      false if a violation error should be added
    • validate

      public final boolean validate(T value, ValidationRequest req, String propertyName)
      Description copied from interface: ValidationAdapter
      Execute validations for the given value.
      Specified by:
      validate in interface ValidationAdapter<T>
      Parameters:
      value - The value to be validated
      req - The validation request containing group/locale/violation information
      propertyName - The name of the property being validated
      Returns:
      true if validation should continue, false otherwise