Class AbstractValidator

java.lang.Object
org.apache.openjpa.validation.AbstractValidator
All Implemented Interfaces:
Validator
Direct Known Subclasses:
ValidatorImpl

public abstract class AbstractValidator extends Object implements Validator
Abstract validation class which provides base validation methods.
  • Constructor Details

    • AbstractValidator

      public AbstractValidator()
  • Method Details

    • validate

      public abstract <T> ValidationException validate(T arg0, int event)
      Description copied from interface: Validator
      Validates a given instance
      Specified by:
      validate in interface Validator
      Type Parameters:
      T - The instance to validate
      Parameters:
      arg0 - The class, of type T to validate
      event - The event id
      Returns:
      ValidationException if the validator produces one or more constraint violations.
    • validateProperty

      public abstract <T> ValidationException validateProperty(T arg0, String property, int event)
      Description copied from interface: Validator
      Validates a property of a given instance
      Specified by:
      validateProperty in interface Validator
      Type Parameters:
      T - The instance to validate
      Parameters:
      arg0 - The class, of type T to validate
      property - The property to validate
      event - The event id
      Returns:
      ValidationException if the validator produces one or more constraint violations.
    • validateValue

      public abstract <T> ValidationException validateValue(Class<T> arg0, String arg1, Object arg2, int event)
      Description copied from interface: Validator
      Validates a value based upon the constraints applied to a given class attribute.
      Specified by:
      validateValue in interface Validator
      Type Parameters:
      T - The instance type to base validation upon
      Parameters:
      arg0 - The class of type T to validate
      arg1 - The property to validate
      arg2 - The property value to validate
      event - The event id
      Returns:
      ValidationException if the validator produces one or more constraint violations.
    • validating

      public <T> boolean validating(T arg0, int event)
      Description copied from interface: Validator
      Method for determining whether validation is active for the given type and event.
      Specified by:
      validating in interface Validator
      Parameters:
      arg0 - Type being validated
      event - event type
      Returns:
      true if validation is active for the specified event