Class AbstractValidator

  • All Implemented Interfaces:
    Validator
    Direct Known Subclasses:
    ValidatorImpl

    public abstract class AbstractValidator
    extends java.lang.Object
    implements Validator
    Abstract validation class which provides base validation methods.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract <T> ValidationException validate​(T arg0, int event)
      Validates a given instance
      abstract <T> ValidationException validateProperty​(T arg0, java.lang.String property, int event)
      Validates a property of a given instance
      abstract <T> ValidationException validateValue​(java.lang.Class<T> arg0, java.lang.String arg1, java.lang.Object arg2, int event)
      Validates a value based upon the constraints applied to a given class attribute.
      <T> boolean validating​(T arg0, int event)
      Method for determining whether validation is active for the given type and event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractValidator

        public AbstractValidator()
    • Method Detail

      • 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,
                                                                 java.lang.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​(java.lang.Class<T> arg0,
                                                              java.lang.String arg1,
                                                              java.lang.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