AnnotationValidator (JUnit API)
Date: 2018-08-04

org.junit.validator

## Class AnnotationValidator

- java.lang.Object
- - org.junit.validator.AnnotationValidator

- Direct Known Subclasses:
    CategoryValidator

      public abstract class AnnotationValidator
      extends java.lang.Object

  Validates annotations on classes and methods. To be validated, an annotation should be annotated with `ValidateWith` Instances of this class are shared by multiple test runners, so they should be immutable and thread-safe.
  Since:
    4.12

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationValidator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.List<java.lang.Exception>` | `validateAnnotatedClass(TestClass testClass)` Validates annotation on the given class.
    `java.util.List<java.lang.Exception>` | `validateAnnotatedField(FrameworkField field)` Validates annotation on the given field.
    `java.util.List<java.lang.Exception>` | `validateAnnotatedMethod(FrameworkMethod method)` Validates annotation on the given method.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### AnnotationValidator

          public AnnotationValidator()

  - ### Method Detail

    - #### validateAnnotatedClass

          public java.util.List<java.lang.Exception> validateAnnotatedClass(TestClass testClass)

      Validates annotation on the given class.
      Parameters:
        `testClass` - that is being validated
      Returns:
        A list of exceptions. Default behavior is to return an empty list.
      Since:
        4.12

    - #### validateAnnotatedField

          public java.util.List<java.lang.Exception> validateAnnotatedField(FrameworkField field)

      Validates annotation on the given field.
      Parameters:
        `field` - that is being validated
      Returns:
        A list of exceptions. Default behavior is to return an empty list.
      Since:
        4.12

    - #### validateAnnotatedMethod

          public java.util.List<java.lang.Exception> validateAnnotatedMethod(FrameworkMethod method)

      Validates annotation on the given method.
      Parameters:
        `method` - that is being validated
      Returns:
        A list of exceptions. Default behavior is to return an empty list.
      Since:
        4.12