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 Summary
Modifier and TypeMethodDescriptioncheckAnnotationType
(TypeElement element, AnnotationMirror annotation) Checks, whether the given annotation is allowed at the given annotation type declaration.checkField
(VariableElement element, AnnotationMirror annotation) Checks, whether the given annotation is allowed at the given field.checkMethod
(ExecutableElement element, AnnotationMirror annotation) Checks, whether the given annotation is allowed at the given method.checkNonAnnotationType
(TypeElement element, AnnotationMirror annotation) Checks, whether the given annotation is allowed at the given type declaration (class, interface, enum).
-
Method Details
-
checkField
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
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
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
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.
-