Interface AnnotationValidator

All Known Implementing Classes:
BasicAnnotationValidator

public interface AnnotationValidator
An annotation validity checker for a specific annotation source.

Implementations of AnnotationValidator should extend BasicAnnotationValidator or one of its derived classes because methods may be added to this API.

Since:
4.22
See Also:
No Implement
Do not implement this interface directly; instead extend BasicAnnotationValidator or one of its subclasses.
  • Method Details

    • getAnnotationSource

      String getAnnotationSource()
      Returns the annotation source of the annotations validated by this annotation validator.
      Returns:
      the annotation source.
    • isValidLocation

      boolean isValidLocation(Annotation annotation)
      Returns whether this annotation with this annotation validator's annotation source is valid at its current location.
      Parameters:
      annotation - the annotation in question.
      Returns:
      whether this annotation with this annotation validator's annotation source is valid at its current location.
    • validate

      boolean validate(Annotation annotation, DiagnosticChain diagnostics, Map<Object,Object> context)
      Returns whether this annotation is valid.
      Parameters:
      annotation - the annotation in question.
      diagnostics - a place to accumulate diagnostics; if it's null, no diagnostics should be produced.
      context - a place to cache information, if it's null, no cache is supported.
      Returns:
      whether this annotation is valid.
      See Also: