org.hibernate.validator.ap.checks

## Interface ConstraintCheck

- All Known Implementing Classes:
    AbstractConstraintCheck, AnnotationTypeCheck, AnnotationTypeMemberCheck, ConstraintValidatorCheck, GetterCheck, GroupSequenceProviderCheck, 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 Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<ConstraintCheckError>` | `checkAnnotationType(TypeElement element, AnnotationMirror annotation)` Checks, whether the given annotation is allowed at the given annotation type declaration.
    `Set<ConstraintCheckError>` | `checkField(VariableElement element, AnnotationMirror annotation)` Checks, whether the given annotation is allowed at the given field.
    `Set<ConstraintCheckError>` | `checkMethod(ExecutableElement element, AnnotationMirror annotation)` Checks, whether the given annotation is allowed at the given method.
    `Set<ConstraintCheckError>` | `checkNonAnnotationType(TypeElement element, AnnotationMirror annotation)` Checks, whether the given annotation is allowed at the given type declaration (class, interface, enum).

- - ### Method Detail

    - #### checkField

          Set<ConstraintCheckError> 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<ConstraintCheckError> 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<ConstraintCheckError> 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<ConstraintCheckError> 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.

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved