public final class ConstraintAnnotationVisitor extends AbstractElementVisitor<Void,List<AnnotationMirror>>
ElementVisitor
that visits annotated elements (type declarations,
methods and fields) and applies different ConstraintCheck
s to them.
Each ConstraintCheckIssue
occurred will be reported using the
Messager
API.messager, verbose
DEFAULT_VALUE
Constructor and Description |
---|
ConstraintAnnotationVisitor(ProcessingEnvironment processingEnvironment,
MessagerAdapter messager,
Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
Void |
visitExecutableAsMethod(ExecutableElement method,
List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
method.
|
Void |
visitTypeAsAnnotationType(TypeElement annotationType,
List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
annotation type declaration.
|
Void |
visitTypeAsClass(TypeElement e,
List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
class type declaration.
|
Void |
visitTypeAsEnum(TypeElement e,
List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
enum type declaration.
|
Void |
visitTypeAsInterface(TypeElement e,
List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given
interface type declaration.
|
Void |
visitVariableAsField(VariableElement annotatedField,
List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
field.
|
Void |
visitVariableAsParameter(VariableElement annotatedField,
List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given
method parameter.
|
reportIssues
visitVariableAsResourceVariable
visitExecutable, visitExecutableAsConstructor, visitExecutableAsInstanceInit, visitExecutableAsStaticInit, visitPackage, visitType, visitTypeParameter, visitVariable, visitVariableAsEnumConstant, visitVariableAsExceptionParameter, visitVariableAsLocalVariable
defaultAction
visit, visit, visitUnknown
public ConstraintAnnotationVisitor(ProcessingEnvironment processingEnvironment, MessagerAdapter messager, Configuration configuration)
public Void visitExecutableAsMethod(ExecutableElement method, List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given method. The following checks are performed:
@Valid
annotation may only be given at non-static,
non-primitive JavaBeans getter methods.visitExecutableAsMethod
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitVariableAsField(VariableElement annotatedField, List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given field. The following checks are performed:
@Valid
annotation may only be given at non-static,
non-primitive fields.visitVariableAsField
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitVariableAsParameter(VariableElement annotatedField, List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given method parameter. The following checks are performed:
visitVariableAsParameter
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitTypeAsAnnotationType(TypeElement annotationType, List<AnnotationMirror> mirrors)
Checks whether the given annotations are correctly specified at the given annotation type declaration. The following checks are performed:
visitTypeAsAnnotationType
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitTypeAsClass(TypeElement e, List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given class type declaration. The following checks are performed:
visitTypeAsClass
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitTypeAsEnum(TypeElement e, List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given enum type declaration. The following checks are performed:
visitTypeAsEnum
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
public Void visitTypeAsInterface(TypeElement e, List<AnnotationMirror> p)
Checks whether the given annotations are correctly specified at the given interface type declaration. The following checks are performed:
visitTypeAsInterface
in class ElementKindVisitor6<Void,List<AnnotationMirror>>
Copyright © 2007-2021 Red Hat, Inc. All Rights Reserved