Interface ConstraintCheck

All Known Implementing Classes:
AbstractConstraintCheck, AnnotationDefaultMessageCheck, AnnotationMessageCheck, AnnotationParametersAbstractCheck, AnnotationParametersDecimalMinMaxCheck, AnnotationParametersDigitsCheck, AnnotationParametersGroupsCheck, AnnotationParametersPatternCheck, AnnotationParametersScriptAssertCheck, AnnotationParametersSizeLengthCheck, AnnotationPayloadUnwrappingCheck, AnnotationTypeCheck, AnnotationTypeMemberCheck, AnnotationUserMessageCheck, ConstraintValidatorCheck, CrossParameterConstraintCheck, GetterCheck, GroupSequenceCheck, GroupSequenceProviderCheck, MethodAnnotationCheck, MixDirectAndListAnnotationCheck, PrimitiveCheck, RetentionPolicyCheck, StaticCheck, TargetCheck, TypeCheck

public interface ConstraintCheck

Implementations represent checks, which determine whether a given constraint annotation is allowed at a given element.

Implementations should be derived from AbstractConstraintCheck in order to implement only those check methods applicable for the element kinds supported by the check.

Author:
Gunnar Morling
  • Method Details

    • checkField

      Set<ConstraintCheckIssue> checkField(VariableElement element, AnnotationMirror annotation)
      Checks, whether the given annotation is allowed at the given field.
      Parameters:
      element - An annotated field.
      annotation - An annotation at that field.
      Returns:
      A set with errors, that describe, why the given annotation is not allowed at the given element. In case no errors occur (the given annotation is allowed at the given element), an empty set must be returned.
    • checkMethod

      Set<ConstraintCheckIssue> checkMethod(ExecutableElement element, AnnotationMirror annotation)
      Checks, whether the given annotation is allowed at the given method.
      Parameters:
      element - An annotated method.
      annotation - An annotation at that method.
      Returns:
      A set with errors, that describe, why the given annotation is not allowed at the given element. In case no errors occur (the given annotation is allowed at the given element), an empty set must be returned.
    • checkAnnotationType

      Set<ConstraintCheckIssue> checkAnnotationType(TypeElement element, AnnotationMirror annotation)
      Checks, whether the given annotation is allowed at the given annotation type declaration.
      Parameters:
      element - An annotated annotation type declaration.
      annotation - An annotation at that annotation type.
      Returns:
      A set with errors, that describe, why the given annotation is not allowed at the given element. In case no errors occur (the given annotation is allowed at the given element), an empty set must be returned.
    • checkNonAnnotationType

      Set<ConstraintCheckIssue> checkNonAnnotationType(TypeElement element, AnnotationMirror annotation)
      Checks, whether the given annotation is allowed at the given type declaration (class, interface, enum).
      Parameters:
      element - An annotated type declaration.
      annotation - An annotation at that type.
      Returns:
      A set with errors, that describe, why the given annotation is not allowed at the given element. In case no errors occur (the given annotation is allowed at the given element), an empty set must be returned.